Class: Squib::DSL::Curve
- Inherits:
-
Object
- Object
- Squib::DSL::Curve
- Includes:
- WarnUnexpectedParams
- Defined in:
- lib/squib/dsl/curve.rb
Instance Attribute Summary collapse
- #deck ⇒ Object readonly
- #dsl_method ⇒ Object readonly
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(deck, dsl_method) ⇒ Curve
constructor
A new instance of Curve.
- #run(opts) ⇒ Object
Methods included from WarnUnexpectedParams
Constructor Details
#initialize(deck, dsl_method) ⇒ Curve
Returns a new instance of Curve.
15 16 17 18 |
# File 'lib/squib/dsl/curve.rb', line 15 def initialize(deck, dsl_method) @deck = deck @dsl_method = dsl_method end |
Instance Attribute Details
#deck ⇒ Object (readonly)
13 14 15 |
# File 'lib/squib/dsl/curve.rb', line 13 def deck @deck end |
#dsl_method ⇒ Object (readonly)
13 14 15 |
# File 'lib/squib/dsl/curve.rb', line 13 def dsl_method @dsl_method end |
Class Method Details
.accepted_params ⇒ Object
20 21 22 23 24 |
# File 'lib/squib/dsl/curve.rb', line 20 def self.accepted_params %i(x1 y1 x2 y2 cx1 cy1 cx2 cy2 fill_color stroke_color stroke_width stroke_strategy join dash cap range layout) end |
Instance Method Details
#run(opts) ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/squib/dsl/curve.rb', line 26 def run(opts) warn_if_unexpected opts range = Args.extract_range opts, deck draw = Args.extract_draw opts, deck coords = Args.extract_coords opts, deck range.each { |i| deck.cards[i].curve(coords[i], draw[i]) } end |