Class: Card::Set::All::ReferenceEditor::LinkEditor::LinkParser

Inherits:
Object
  • Object
show all
Defined in:
platypus/tmp/set/gem-defaults/mod033-tinymce_editor/all/reference_editor/link_editor/link_parser.rb

Overview

from a link syntax string

Defined Under Namespace

Classes: Link

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(link_string) ⇒ LinkParser

Returns a new instance of LinkParser.



22
23
24
25
26
27
# File 'platypus/tmp/set/gem-defaults/mod033-tinymce_editor/all/reference_editor/link_editor/link_parser.rb', line 22

def initialize link_string
  @raw = link_string
  link = Card::Content::Chunk::Link.new link_string, nil
  init_name link.name
  @options = link.options
end

Instance Attribute Details

#fieldObject (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

#nameObject (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

#optionsObject (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
  @options
end

#rawObject (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



16
17
18
19
20
# File 'platypus/tmp/set/gem-defaults/mod033-tinymce_editor/all/reference_editor/link_editor/link_parser.rb', line 16

def self.new link_string
  return super if link_string.is_a? String

  Link.new("", {}, "[[ ]]")
end

Instance Method Details

#field?Boolean

Returns:

  • (Boolean)


33
34
35
# File 'platypus/tmp/set/gem-defaults/mod033-tinymce_editor/all/reference_editor/link_editor/link_parser.rb', line 33

def field?
  @field
end

#titleObject



29
30
31
# File 'platypus/tmp/set/gem-defaults/mod033-tinymce_editor/all/reference_editor/link_editor/link_parser.rb', line 29

def title
  @options && @options[:title]
end