Class: Flok::TransitionCompilerContext

Inherits:
Object
  • Object
show all
Defined in:
lib/flok/transition_compiler.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeTransitionCompilerContext

Returns a new instance of TransitionCompilerContext.



30
31
32
33
34
# File 'lib/flok/transition_compiler.rb', line 30

def initialize
  @controllers = []
  @actions = []
  @ons = []
end

Instance Attribute Details

#actionsObject

Returns the value of attribute actions.



28
29
30
# File 'lib/flok/transition_compiler.rb', line 28

def actions
  @actions
end

#controllersObject

Returns the value of attribute controllers.



28
29
30
# File 'lib/flok/transition_compiler.rb', line 28

def controllers
  @controllers
end

#onsObject

Returns the value of attribute ons.



28
29
30
# File 'lib/flok/transition_compiler.rb', line 28

def ons
  @ons
end

Instance Method Details

#action(controller, name, &block) ⇒ Object



43
44
45
# File 'lib/flok/transition_compiler.rb', line 43

def action controller, name, &block
  @actions << TransitionCompilerAction.new(controller, name, self, &block)
end

#actions_for_controller(controller_name) ⇒ Object



50
51
52
# File 'lib/flok/transition_compiler.rb', line 50

def actions_for_controller controller_name
  return @actions.select{|e| e.controller.name == controller_name}
end

#get_bindingObject



36
37
38
# File 'lib/flok/transition_compiler.rb', line 36

def get_binding
  return binding
end

#on(controller_name, action_name, name, &block) ⇒ Object



47
48
# File 'lib/flok/transition_compiler.rb', line 47

def on controller_name, action_name, name, &block
end

#spots_for_controller(controller_name) ⇒ Object



54
55
56
# File 'lib/flok/transition_compiler.rb', line 54

def spots_for_controller controller_name
  return @controllers.detect{|e| e.name == controller_name}.spots
end

#transition(name, &block) ⇒ Object



40
41
# File 'lib/flok/transition_compiler.rb', line 40

def transition name, &block
end