Class: Viewmaster::Transition

Inherits:
Object
  • Object
show all
Defined in:
lib/viewmaster/transition.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) {|_self| ... } ⇒ Transition

Returns a new instance of Transition.

Yields:

  • (_self)

Yield Parameters:



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

#callbackObject

Returns the value of attribute callback.



5
6
7
# File 'lib/viewmaster/transition.rb', line 5

def callback
  @callback
end

#filterObject

Returns the value of attribute filter.



6
7
8
# File 'lib/viewmaster/transition.rb', line 6

def filter
  @filter
end

#fromObject

Returns the value of attribute from.



3
4
5
# File 'lib/viewmaster/transition.rb', line 3

def from
  @from
end

#toObject

Returns the value of attribute to.



4
5
6
# File 'lib/viewmaster/transition.rb', line 4

def to
  @to
end

Instance Method Details

#run_callbackObject



16
17
18
# File 'lib/viewmaster/transition.rb', line 16

def run_callback
  callback.call unless callback.blank?
end