Class: Plushie::Canvas::Shape::Dash
- Inherits:
-
Data
- Object
- Data
- Plushie::Canvas::Shape::Dash
- Defined in:
- lib/plushie/canvas/shape/dash.rb
Overview
Dash pattern for canvas shape strokes.
Instance Attribute Summary collapse
-
#offset ⇒ Object
readonly
Returns the value of attribute offset.
-
#segments ⇒ Object
readonly
Returns the value of attribute segments.
Instance Method Summary collapse
-
#[](key) ⇒ Object
Backward-compatible hash-style access.
-
#initialize(segments:, offset:) ⇒ Dash
constructor
A new instance of Dash.
-
#to_wire ⇒ Hash
Wire-ready dash map.
Constructor Details
#initialize(segments:, offset:) ⇒ Dash
Returns a new instance of Dash.
12 13 14 |
# File 'lib/plushie/canvas/shape/dash.rb', line 12 def initialize(segments:, offset:) super end |
Instance Attribute Details
#offset ⇒ Object (readonly)
Returns the value of attribute offset
11 12 13 |
# File 'lib/plushie/canvas/shape/dash.rb', line 11 def offset @offset end |
#segments ⇒ Object (readonly)
Returns the value of attribute segments
11 12 13 |
# File 'lib/plushie/canvas/shape/dash.rb', line 11 def segments @segments end |
Instance Method Details
#[](key) ⇒ Object
Backward-compatible hash-style access.
17 |
# File 'lib/plushie/canvas/shape/dash.rb', line 17 def [](key) = to_wire[key] |
#to_wire ⇒ Hash
Returns wire-ready dash map.
20 21 22 |
# File 'lib/plushie/canvas/shape/dash.rb', line 20 def to_wire {segments: segments, offset: offset} end |