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.



307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
# File 'lib/org-parse/node.rb', line 307

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.



305
306
307
# File 'lib/org-parse/node.rb', line 305

def caption
  @caption
end

#html_optionsObject (readonly)

Returns the value of attribute html_options.



305
306
307
# File 'lib/org-parse/node.rb', line 305

def html_options
  @html_options
end

Instance Method Details

#uriObject

href



324
325
326
# File 'lib/org-parse/node.rb', line 324

def uri
  @value
end