Class: Flok::UserCompilerController
- Inherits:
-
Object
- Object
- Flok::UserCompilerController
- Includes:
- UserCompilerMacro
- Defined in:
- lib/flok/user_compiler.rb
Instance Attribute Summary collapse
-
#_on_entry ⇒ Object
Returns the value of attribute _on_entry.
-
#_services ⇒ Object
Returns the value of attribute _services.
-
#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) ⇒ UserCompilerController
constructor
A new instance of UserCompilerController.
-
#macro(name, &block) ⇒ Object
Create an action macro.
- #on_entry(str) ⇒ Object
- #services(*instance_names) ⇒ Object
Methods included from UserCompilerMacro
Constructor Details
#initialize(name, ctx, &block) ⇒ UserCompilerController
Returns a new instance of UserCompilerController.
471 472 473 474 475 476 477 478 479 480 481 482 |
# File 'lib/flok/user_compiler.rb', line 471 def initialize name, ctx, &block @name = name @ctx = ctx @spots = ['main'] @macros = {} @_services = [] #Some macros expect controller instance @controller = self self.instance_eval(&block) end |
Instance Attribute Details
#_on_entry ⇒ Object
Returns the value of attribute _on_entry.
470 471 472 |
# File 'lib/flok/user_compiler.rb', line 470 def _on_entry @_on_entry end |
#_services ⇒ Object
Returns the value of attribute _services.
470 471 472 |
# File 'lib/flok/user_compiler.rb', line 470 def _services @_services end |
#macros ⇒ Object
Returns the value of attribute macros.
470 471 472 |
# File 'lib/flok/user_compiler.rb', line 470 def macros @macros end |
#name ⇒ Object
Returns the value of attribute name.
470 471 472 |
# File 'lib/flok/user_compiler.rb', line 470 def name @name end |
#spots(*spots) ⇒ Object
Names of spots
494 495 496 |
# File 'lib/flok/user_compiler.rb', line 494 def spots @spots end |
Instance Method Details
#action(name, &block) ⇒ Object
Pass through action
503 504 505 |
# File 'lib/flok/user_compiler.rb', line 503 def action name, &block @ctx.action self, name, &block end |
#macro(name, &block) ⇒ Object
Create an action macro
485 486 487 |
# File 'lib/flok/user_compiler.rb', line 485 def macro name, &block @macros[name] = block end |
#on_entry(str) ⇒ Object
489 490 491 |
# File 'lib/flok/user_compiler.rb', line 489 def on_entry str @_on_entry = _macro(str) end |
#services(*instance_names) ⇒ Object
498 499 500 |
# File 'lib/flok/user_compiler.rb', line 498 def services *instance_names @_services = instance_names.map{|e| e.to_s} end |