Class: ManaMana::RDSL::Node

Inherits:
Object
  • Object
show all
Defined in:
lib/manamana/rdsl/nodes.rb

Direct Known Subclasses

ExamplesNode, NodeWithOffset, RootNode

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}, children = []) ⇒ Node

Returns a new instance of Node.



8
9
10
11
# File 'lib/manamana/rdsl/nodes.rb', line 8

def initialize(options={}, children=[])
  @children = children
  @name     = options[:value] || ''
end

Instance Attribute Details

#childrenObject (readonly)

Returns the value of attribute children.



6
7
8
# File 'lib/manamana/rdsl/nodes.rb', line 6

def children
  @children
end

#nameObject (readonly)

Returns the value of attribute name.



6
7
8
# File 'lib/manamana/rdsl/nodes.rb', line 6

def name
  @name
end

Instance Method Details

#==(other_node) ⇒ Object



13
14
15
# File 'lib/manamana/rdsl/nodes.rb', line 13

def ==(other_node)
  name == other_node.name && @children == other_node.children
end