Class: Hexflex::Triangle
- Inherits:
-
Object
- Object
- Hexflex::Triangle
- Defined in:
- lib/hexflex/triangle.rb
Instance Attribute Summary collapse
-
#fill ⇒ Object
Returns the value of attribute fill.
-
#index ⇒ Object
Returns the value of attribute index.
Class Method Summary collapse
Instance Method Summary collapse
- #color_fill? ⇒ Boolean
- #image_fill? ⇒ Boolean
-
#initialize(opts = {}) ⇒ Triangle
constructor
A new instance of Triangle.
Constructor Details
#initialize(opts = {}) ⇒ Triangle
Returns a new instance of Triangle.
6 7 8 9 |
# File 'lib/hexflex/triangle.rb', line 6 def initialize(opts = {}) @fill = opts[:fill] @index = opts[:index] end |
Instance Attribute Details
#fill ⇒ Object
Returns the value of attribute fill.
4 5 6 |
# File 'lib/hexflex/triangle.rb', line 4 def fill @fill end |
#index ⇒ Object
Returns the value of attribute index.
4 5 6 |
# File 'lib/hexflex/triangle.rb', line 4 def index @index end |
Class Method Details
.place_holder ⇒ Object
20 21 22 |
# File 'lib/hexflex/triangle.rb', line 20 def place_holder new(fill: "grey") end |
Instance Method Details
#color_fill? ⇒ Boolean
15 16 17 |
# File 'lib/hexflex/triangle.rb', line 15 def color_fill? !image_fill? end |
#image_fill? ⇒ Boolean
11 12 13 |
# File 'lib/hexflex/triangle.rb', line 11 def image_fill? @fill.to_s.include? '.' end |