Class: Flok::UserCompilerController
- Inherits:
-
Object
- Object
- Flok::UserCompilerController
- Defined in:
- lib/flok/user_compiler.rb
Instance Attribute Summary collapse
-
#_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.
- #services(*instance_names) ⇒ Object
Constructor Details
#initialize(name, ctx, &block) ⇒ UserCompilerController
Returns a new instance of UserCompilerController.
399 400 401 402 403 404 405 406 407 |
# File 'lib/flok/user_compiler.rb', line 399 def initialize name, ctx, &block @name = name @ctx = ctx @spots = ['main'] @macros = {} @_services = [] self.instance_eval(&block) end |
Instance Attribute Details
#_services ⇒ Object
Returns the value of attribute _services.
398 399 400 |
# File 'lib/flok/user_compiler.rb', line 398 def _services @_services end |
#macros ⇒ Object
Returns the value of attribute macros.
398 399 400 |
# File 'lib/flok/user_compiler.rb', line 398 def macros @macros end |
#name ⇒ Object
Returns the value of attribute name.
398 399 400 |
# File 'lib/flok/user_compiler.rb', line 398 def name @name end |
#spots(*spots) ⇒ Object
Names of spots
415 416 417 |
# File 'lib/flok/user_compiler.rb', line 415 def spots @spots end |
Instance Method Details
#action(name, &block) ⇒ Object
Pass through action
424 425 426 |
# File 'lib/flok/user_compiler.rb', line 424 def action name, &block @ctx.action self, name, &block end |
#macro(name, &block) ⇒ Object
Create an action macro
410 411 412 |
# File 'lib/flok/user_compiler.rb', line 410 def macro name, &block @macros[name] = block end |
#services(*instance_names) ⇒ Object
419 420 421 |
# File 'lib/flok/user_compiler.rb', line 419 def services *instance_names @_services = instance_names.map{|e| e.to_s} end |