Class: OrgParse::LinkNode

Inherits:
Node
  • Object
show all
Defined in:
lib/org-parse/node.rb

Overview

Link保持

Instance Attribute Summary collapse

Attributes inherited from Node

#children, #kind, #parent, #value

Instance Method Summary collapse

Methods inherited from Node

#done, #done?, #example?, #html?, #inspect, #is_leaf?, #section_no_array, #set_example, #set_html, #set_src, #set_to_descendant, #set_verse, #src?, #verse?

Constructor Details

#initialize(uri, children = [], vars = []) ⇒ LinkNode

Returns a new instance of LinkNode.



297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
# File 'lib/org-parse/node.rb', line 297

def initialize(uri, children = [], vars = [])
  @html_options = {}
  @caption = nil
  vars.each do |v|
    if v =~ /^CAPTION:(.+)$/
      @caption = $1.chomp
    else
      while v =~ /([^ =]+)=("[^"]+")/
        @html_options[$1] = $2
        v = $'
      end
    end
  end
  super(:LINK, children, uri)
end

Instance Attribute Details

#captionObject (readonly)

Returns the value of attribute caption.



295
296
297
# File 'lib/org-parse/node.rb', line 295

def caption
  @caption
end

#html_optionsObject (readonly)

Returns the value of attribute html_options.



295
296
297
# File 'lib/org-parse/node.rb', line 295

def html_options
  @html_options
end

Instance Method Details

#uriObject

href



314
315
316
# File 'lib/org-parse/node.rb', line 314

def uri
  @value
end