Class: Card::Set::All::ReferenceEditor::LinkEditor::LinkParser
- Defined in:
- platypus/tmp/set/gem-defaults/mod033-tinymce_editor/all/reference_editor/link_editor/link_parser.rb
Overview
from a link syntax string
Instance Attribute Summary collapse
-
#field ⇒ Object
readonly
Returns the value of attribute field.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
Class Method Summary collapse
Instance Method Summary collapse
-
#field? ⇒ Boolean
-
#initialize(link_string) ⇒ LinkParser
constructor
A new instance of LinkParser.
-
#title ⇒ Object
Constructor Details
#initialize(link_string) ⇒ LinkParser
Returns a new instance of LinkParser.
20 21 22 23 24 25 |
# File 'platypus/tmp/set/gem-defaults/mod033-tinymce_editor/all/reference_editor/link_editor/link_parser.rb', line 20 def initialize link_string @raw = link_string link = Card::Content::Chunk::Link.new link_string, nil init_name link.name @options = link. end |
Instance Attribute Details
#field ⇒ Object (readonly)
Returns the value of attribute field.
12 13 14 |
# File 'platypus/tmp/set/gem-defaults/mod033-tinymce_editor/all/reference_editor/link_editor/link_parser.rb', line 12 def field @field end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
12 13 14 |
# File 'platypus/tmp/set/gem-defaults/mod033-tinymce_editor/all/reference_editor/link_editor/link_parser.rb', line 12 def name @name end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
12 13 14 |
# File 'platypus/tmp/set/gem-defaults/mod033-tinymce_editor/all/reference_editor/link_editor/link_parser.rb', line 12 def @options end |
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
12 13 14 |
# File 'platypus/tmp/set/gem-defaults/mod033-tinymce_editor/all/reference_editor/link_editor/link_parser.rb', line 12 def raw @raw end |
Class Method Details
.new(link_string) ⇒ Object
14 15 16 17 18 |
# File 'platypus/tmp/set/gem-defaults/mod033-tinymce_editor/all/reference_editor/link_editor/link_parser.rb', line 14 def self.new link_string return super if link_string.is_a? String OpenStruct.new(name: "", options: {}, raw: "[[ ]]") end |
Instance Method Details
#field? ⇒ Boolean
31 32 33 |
# File 'platypus/tmp/set/gem-defaults/mod033-tinymce_editor/all/reference_editor/link_editor/link_parser.rb', line 31 def field? @field end |
#title ⇒ Object
27 28 29 |
# File 'platypus/tmp/set/gem-defaults/mod033-tinymce_editor/all/reference_editor/link_editor/link_parser.rb', line 27 def title @options && @options[:title] end |