Class: Megingiard::Node
- Inherits:
-
Object
- Object
- Megingiard::Node
- Defined in:
- lib/megingiard/node.rb
Overview
A node with arbitrary many children
Instance Method Summary collapse
-
#initialize(*children) ⇒ Node
constructor
A new instance of Node.
- #to_s ⇒ Object
Constructor Details
#initialize(*children) ⇒ Node
Returns a new instance of Node.
5 6 7 |
# File 'lib/megingiard/node.rb', line 5 def initialize(*children) @children = children end |
Instance Method Details
#to_s ⇒ Object
9 10 11 |
# File 'lib/megingiard/node.rb', line 9 def to_s @children.map(&:to_s).reduce(:+) end |