Class: VectorSalad::StandardShapes::IsoTri
- Inherits:
-
BasicShape
- Object
- BasicShape
- VectorSalad::StandardShapes::IsoTri
- Includes:
- Mixins::At
- Defined in:
- lib/vector_salad/standard_shapes/iso_tri.rb
Overview
Isosceles or right-angle triangle shape.
Instance Attribute Summary collapse
-
#height ⇒ Object
readonly
Returns the value of attribute height.
Attributes inherited from BasicShape
Instance Method Summary collapse
-
#initialize(width = nil, height, **options) ⇒ IsoTri
constructor
A new instance of IsoTri.
-
#to_path ⇒ Object
Convert the shape to a path.
Methods included from Mixins::At
Methods inherited from BasicShape
#flip, #flip_x, #flip_y, #jitter, #move, #rotate, #scale, #to_a, #to_bezier_path, #to_cubic_path, #to_multi_path, #to_simple_path, #to_svg
Constructor Details
#initialize(width = nil, height, **options) ⇒ IsoTri
Returns a new instance of IsoTri.
21 22 23 24 25 26 27 |
# File 'lib/vector_salad/standard_shapes/iso_tri.rb', line 21 def initialize(width = nil, height, **) width = height * 2 if width.nil? @width, @height = width, height @options = @x, @y = 0, 0 self end |
Instance Attribute Details
#height ⇒ Object (readonly)
Returns the value of attribute height.
11 12 13 |
# File 'lib/vector_salad/standard_shapes/iso_tri.rb', line 11 def height @height end |