Class: Paggio::CSS::Animation
- Inherits:
- BasicObject
- Defined in:
- lib/paggio/css/animation.rb
Defined Under Namespace
Classes: Step
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#steps ⇒ Object
readonly
Returns the value of attribute steps.
Instance Method Summary collapse
- #from(value, &block) ⇒ Object
-
#initialize(name) ⇒ Animation
constructor
A new instance of Animation.
- #method_missing(*args, &block) ⇒ Object
- #step(value, &block) ⇒ Object
- #to(value, &block) ⇒ Object
Constructor Details
#initialize(name) ⇒ Animation
Returns a new instance of Animation.
29 30 31 32 |
# File 'lib/paggio/css/animation.rb', line 29 def initialize(name) @name = name @steps = [] end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(*args, &block) ⇒ Object
49 50 51 |
# File 'lib/paggio/css/animation.rb', line 49 def method_missing(*args, &block) @steps.last.__send__(*args, &block) end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
27 28 29 |
# File 'lib/paggio/css/animation.rb', line 27 def name @name end |
#steps ⇒ Object (readonly)
Returns the value of attribute steps.
27 28 29 |
# File 'lib/paggio/css/animation.rb', line 27 def steps @steps end |
Instance Method Details
#from(value, &block) ⇒ Object
39 40 41 42 |
# File 'lib/paggio/css/animation.rb', line 39 def from(value, &block) @steps << Step.new(0.%) block.call end |