Class: Slice
- Inherits:
-
Object
- Object
- Slice
- Defined in:
- lib/slicer/slice.rb
Instance Attribute Summary collapse
-
#children ⇒ Object
Returns the value of attribute children.
-
#colour ⇒ Object
(also: #color)
Returns the value of attribute colour.
-
#name ⇒ Object
Returns the value of attribute name.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
- #<<(slice) ⇒ Object
-
#initialize(name = nil, color = nil, value = nil) ⇒ Slice
constructor
A new instance of Slice.
Constructor Details
#initialize(name = nil, color = nil, value = nil) ⇒ Slice
Returns a new instance of Slice.
7 8 9 10 11 12 |
# File 'lib/slicer/slice.rb', line 7 def initialize(name = nil, color = nil, value = nil) self.name = name self.color = color self.value = value self.children = nil end |
Instance Attribute Details
#children ⇒ Object
Returns the value of attribute children.
2 3 4 |
# File 'lib/slicer/slice.rb', line 2 def children @children end |
#colour ⇒ Object Also known as: color
Returns the value of attribute colour.
2 3 4 |
# File 'lib/slicer/slice.rb', line 2 def colour @colour end |
#name ⇒ Object
Returns the value of attribute name.
2 3 4 |
# File 'lib/slicer/slice.rb', line 2 def name @name end |
#value ⇒ Object
Returns the value of attribute value.
2 3 4 |
# File 'lib/slicer/slice.rb', line 2 def value @value end |
Instance Method Details
#<<(slice) ⇒ Object
14 15 16 17 |
# File 'lib/slicer/slice.rb', line 14 def <<(slice) self.children = [] if self.children.nil? self.children << slice end |