Class: Ea::Shapescript::Shape
- Inherits:
-
Struct
- Object
- Struct
- Ea::Shapescript::Shape
- Defined in:
- lib/ea/shapescript/shape.rb
Overview
One rendered shape primitive. Carries type + params ready for SVG emission.
Instance Attribute Summary collapse
-
#kind ⇒ Object
Returns the value of attribute kind.
-
#params ⇒ Object
Returns the value of attribute params.
Instance Method Summary collapse
- #ellipse? ⇒ Boolean
- #label? ⇒ Boolean
- #line? ⇒ Boolean
- #path? ⇒ Boolean
- #polygon? ⇒ Boolean
-
#rectangle? ⇒ Boolean
True when this shape is a rectangle.
Instance Attribute Details
#kind ⇒ Object
Returns the value of attribute kind
7 8 9 |
# File 'lib/ea/shapescript/shape.rb', line 7 def kind @kind end |
#params ⇒ Object
Returns the value of attribute params
7 8 9 |
# File 'lib/ea/shapescript/shape.rb', line 7 def params @params end |
Instance Method Details
#ellipse? ⇒ Boolean
13 14 15 |
# File 'lib/ea/shapescript/shape.rb', line 13 def ellipse? kind == :ellipse end |
#label? ⇒ Boolean
29 30 31 |
# File 'lib/ea/shapescript/shape.rb', line 29 def label? kind == :label end |
#line? ⇒ Boolean
21 22 23 |
# File 'lib/ea/shapescript/shape.rb', line 21 def line? kind == :line end |
#path? ⇒ Boolean
25 26 27 |
# File 'lib/ea/shapescript/shape.rb', line 25 def path? kind == :path end |
#polygon? ⇒ Boolean
17 18 19 |
# File 'lib/ea/shapescript/shape.rb', line 17 def polygon? kind == :polygon end |
#rectangle? ⇒ Boolean
Returns true when this shape is a rectangle.
9 10 11 |
# File 'lib/ea/shapescript/shape.rb', line 9 def rectangle? kind == :rectangle end |