Class: Viewmaster::Transition
- Inherits:
-
Object
- Object
- Viewmaster::Transition
- Defined in:
- lib/viewmaster/transition.rb
Instance Attribute Summary collapse
-
#callback ⇒ Object
Returns the value of attribute callback.
-
#filter ⇒ Object
Returns the value of attribute filter.
-
#from ⇒ Object
Returns the value of attribute from.
-
#to ⇒ Object
Returns the value of attribute to.
Instance Method Summary collapse
-
#initialize(opts = {}) {|_self| ... } ⇒ Transition
constructor
A new instance of Transition.
- #run_callback ⇒ Object
Constructor Details
#initialize(opts = {}) {|_self| ... } ⇒ Transition
Returns a new instance of Transition.
8 9 10 11 12 13 14 |
# File 'lib/viewmaster/transition.rb', line 8 def initialize(opts={}, &block) @to = opts[:to] @from = opts[:from] @callback = opts[:do] @filter = opts[:filter] yield self end |
Instance Attribute Details
#callback ⇒ Object
Returns the value of attribute callback.
5 6 7 |
# File 'lib/viewmaster/transition.rb', line 5 def callback @callback end |
#filter ⇒ Object
Returns the value of attribute filter.
6 7 8 |
# File 'lib/viewmaster/transition.rb', line 6 def filter @filter end |
#from ⇒ Object
Returns the value of attribute from.
3 4 5 |
# File 'lib/viewmaster/transition.rb', line 3 def from @from end |
#to ⇒ Object
Returns the value of attribute to.
4 5 6 |
# File 'lib/viewmaster/transition.rb', line 4 def to @to end |
Instance Method Details
#run_callback ⇒ Object
16 17 18 |
# File 'lib/viewmaster/transition.rb', line 16 def run_callback callback.call unless callback.blank? end |