Class: Megingiard::Node

Inherits:
Object
  • Object
show all
Defined in:
lib/megingiard/node.rb

Overview

A node with arbitrary many children

Instance Method Summary collapse

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_sObject



9
10
11
# File 'lib/megingiard/node.rb', line 9

def to_s
  @children.map(&:to_s).reduce(:+)
end