Class: NoraMark::DLItem

Inherits:
Node
  • Object
show all
Defined in:
lib/nora_mark/node.rb,
lib/nora_mark/parser.kpeg.rb

Instance Attribute Summary collapse

Attributes inherited from Node

#attrs, #body_empty, #content, #first_child, #holders, #last_child, #name, #next, #no_tag, #parent, #prev, #raw_text

Instance Method Summary collapse

Methods inherited from Node

#_find_node, #_match?, #_remove_internal, #add_attr, #after, #all_nodes, #ancestors, #append_child, #before, #build_selector, #children, #children=, #children_empty?, #children_replaced, #clone, #each, #find_node, #match?, #modify_selector, #named_params=, #params=, #prepend_child, #raw_text?, #rebuild_children, #remove, #remove_following, #reparent, #replace, #unlink, #wrap

Constructor Details

#initialize(ids, classes, params, named_params, raw_content, line_no) ⇒ DLItem

Returns a new instance of DLItem.



70
71
72
73
74
75
76
77
# File 'lib/nora_mark/parser.kpeg.rb', line 70

def initialize(ids, classes, params, named_params, raw_content, line_no)
  @ids = ids
  @classes = classes
  @params = params
  @named_params = named_params
  @raw_content = raw_content
  @line_no = line_no
end

Instance Attribute Details

#classesObject (readonly)

Returns the value of attribute classes.



79
80
81
# File 'lib/nora_mark/parser.kpeg.rb', line 79

def classes
  @classes
end

#idsObject (readonly)

Returns the value of attribute ids.



78
79
80
# File 'lib/nora_mark/parser.kpeg.rb', line 78

def ids
  @ids
end

#line_noObject (readonly)

Returns the value of attribute line_no.



83
84
85
# File 'lib/nora_mark/parser.kpeg.rb', line 83

def line_no
  @line_no
end

#named_paramsObject (readonly)

Returns the value of attribute named_params.



81
82
83
# File 'lib/nora_mark/parser.kpeg.rb', line 81

def named_params
  @named_params
end

#paramsObject (readonly)

Returns the value of attribute params.



80
81
82
# File 'lib/nora_mark/parser.kpeg.rb', line 80

def params
  @params
end

#raw_contentObject (readonly)

Returns the value of attribute raw_content.



82
83
84
# File 'lib/nora_mark/parser.kpeg.rb', line 82

def raw_content
  @raw_content
end

Instance Method Details

#textObject



337
338
339
340
341
# File 'lib/nora_mark/node.rb', line 337

def text
  @params[0].inject('') do |result, node|
    result << node.text
  end << super
end