Class: Flok::TransitionCompilerContext
- Inherits:
-
Object
- Object
- Flok::TransitionCompilerContext
- Defined in:
- lib/flok/transition_compiler.rb
Instance Attribute Summary collapse
-
#actions ⇒ Object
Returns the value of attribute actions.
-
#controllers ⇒ Object
Returns the value of attribute controllers.
-
#ons ⇒ Object
Returns the value of attribute ons.
Instance Method Summary collapse
- #action(controller, name, &block) ⇒ Object
- #actions_for_controller(controller_name) ⇒ Object
- #get_binding ⇒ Object
-
#initialize ⇒ TransitionCompilerContext
constructor
A new instance of TransitionCompilerContext.
- #on(controller_name, action_name, name, &block) ⇒ Object
- #spots_for_controller(controller_name) ⇒ Object
- #transition(name, &block) ⇒ Object
Constructor Details
#initialize ⇒ TransitionCompilerContext
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
#actions ⇒ Object
Returns the value of attribute actions.
28 29 30 |
# File 'lib/flok/transition_compiler.rb', line 28 def actions @actions end |
#controllers ⇒ Object
Returns the value of attribute controllers.
28 29 30 |
# File 'lib/flok/transition_compiler.rb', line 28 def controllers @controllers end |
#ons ⇒ Object
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_binding ⇒ Object
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 |