Class: Patchwork
- Inherits:
-
Object
- Object
- Patchwork
- Defined in:
- lib/patchwork.rb
Instance Attribute Summary collapse
-
#nodes ⇒ Object
readonly
Returns the value of attribute nodes.
Instance Method Summary collapse
- #add_node(data) ⇒ Object
-
#initialize ⇒ Patchwork
constructor
A new instance of Patchwork.
Constructor Details
#initialize ⇒ Patchwork
Returns a new instance of Patchwork.
8 9 10 |
# File 'lib/patchwork.rb', line 8 def initialize @nodes = [] end |
Instance Attribute Details
#nodes ⇒ Object (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 |