Class: Context::DSL::Block
- Inherits:
-
Object
- Object
- Context::DSL::Block
- Defined in:
- lib/mashfeed/dsl.rb
Overview
block statement super class
Direct Known Subclasses
Instance Attribute Summary collapse
-
#child_statements ⇒ Object
Returns the value of attribute child_statements.
-
#context_dsl ⇒ Object
Returns the value of attribute context_dsl.
-
#parent_block ⇒ Object
Returns the value of attribute parent_block.
Instance Method Summary collapse
- #execute(recipe) ⇒ Object
-
#initialize(context_dsl, parent_block, *args) ⇒ Block
constructor
A new instance of Block.
- #to_statement ⇒ Object
Constructor Details
#initialize(context_dsl, parent_block, *args) ⇒ Block
Returns a new instance of Block.
20 21 22 |
# File 'lib/mashfeed/dsl.rb', line 20 def initialize(context_dsl, parent_block, *args) @context_dsl, @parent_block, @child_statements = context_dsl, parent_block, [] end |
Instance Attribute Details
#child_statements ⇒ Object
Returns the value of attribute child_statements.
18 19 20 |
# File 'lib/mashfeed/dsl.rb', line 18 def child_statements @child_statements end |
#context_dsl ⇒ Object
Returns the value of attribute context_dsl.
18 19 20 |
# File 'lib/mashfeed/dsl.rb', line 18 def context_dsl @context_dsl end |
#parent_block ⇒ Object
Returns the value of attribute parent_block.
18 19 20 |
# File 'lib/mashfeed/dsl.rb', line 18 def parent_block @parent_block end |
Instance Method Details
#execute(recipe) ⇒ Object
24 25 26 27 28 29 30 |
# File 'lib/mashfeed/dsl.rb', line 24 def execute(recipe) before_execute(recipe) if respond_to?(:before_execute) recipe.call unless recipe.nil? statement = self.to_statement after_execute(statement) if respond_to?(:after_execute) statement end |
#to_statement ⇒ Object
32 33 34 |
# File 'lib/mashfeed/dsl.rb', line 32 def to_statement raise "Need override" end |