Class: Hexflex::Side
- Inherits:
-
Object
- Object
- Hexflex::Side
- Defined in:
- lib/hexflex/side.rb
Instance Attribute Summary collapse
-
#fill ⇒ Object
Returns the value of attribute fill.
-
#triangles ⇒ Object
Returns the value of attribute triangles.
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ Side
constructor
make a new side of a hexaflexagon.
Constructor Details
#initialize(opts = {}) ⇒ Side
make a new side of a hexaflexagon
11 12 13 14 15 16 |
# File 'lib/hexflex/side.rb', line 11 def initialize(opts = {}) self.fill = opts[:fill] self.triangles = Array.new(6) do |index| Triangle.new(fill: fill, index: index) end end |
Instance Attribute Details
#fill ⇒ Object
Returns the value of attribute fill.
5 6 7 |
# File 'lib/hexflex/side.rb', line 5 def fill @fill end |
#triangles ⇒ Object
Returns the value of attribute triangles.
5 6 7 |
# File 'lib/hexflex/side.rb', line 5 def triangles @triangles end |