Class: Patchwork

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializePatchwork

Returns a new instance of Patchwork.



8
9
10
# File 'lib/patchwork.rb', line 8

def initialize
  @nodes = []
end

Instance Attribute Details

#nodesObject (readonly)

Returns the value of attribute nodes.



6
7
8
# File 'lib/patchwork.rb', line 6

def nodes
  @nodes
end

Instance Method Details

#add_node(data) ⇒ Object



12
13
14
15
16
# File 'lib/patchwork.rb', line 12

def add_node(data)
  new_node = PatchworkInternal::Node.new(data)
  @nodes << new_node
  new_node
end