Class: Flok::TransitionCompilerController
- Inherits:
-
Object
- Object
- Flok::TransitionCompilerController
- Defined in:
- lib/flok/transition_compiler.rb
Instance Attribute Summary collapse
-
#macros ⇒ Object
Returns the value of attribute macros.
-
#name ⇒ Object
Returns the value of attribute name.
-
#spots(*spots) ⇒ Object
Names of spots.
Instance Method Summary collapse
-
#action(name, &block) ⇒ Object
Pass through action.
-
#initialize(name, ctx, &block) ⇒ TransitionCompilerController
constructor
A new instance of TransitionCompilerController.
-
#macro(name, &block) ⇒ Object
Create an action macro.
Constructor Details
#initialize(name, ctx, &block) ⇒ TransitionCompilerController
Returns a new instance of TransitionCompilerController.
268 269 270 271 272 273 274 275 |
# File 'lib/flok/transition_compiler.rb', line 268 def initialize name, ctx, &block @name = name @ctx = ctx @spots = ['main'] @macros = {} self.instance_eval(&block) end |
Instance Attribute Details
#macros ⇒ Object
Returns the value of attribute macros.
267 268 269 |
# File 'lib/flok/transition_compiler.rb', line 267 def macros @macros end |
#name ⇒ Object
Returns the value of attribute name.
267 268 269 |
# File 'lib/flok/transition_compiler.rb', line 267 def name @name end |
#spots(*spots) ⇒ Object
Names of spots
283 284 285 |
# File 'lib/flok/transition_compiler.rb', line 283 def spots @spots end |
Instance Method Details
#action(name, &block) ⇒ Object
Pass through action
288 289 290 |
# File 'lib/flok/transition_compiler.rb', line 288 def action name, &block @ctx.action self, name, &block end |
#macro(name, &block) ⇒ Object
Create an action macro
278 279 280 |
# File 'lib/flok/transition_compiler.rb', line 278 def macro name, &block @macros[name] = block end |