Class: Producer::Core::Recipe::DSL
- Inherits:
-
Object
- Object
- Producer::Core::Recipe::DSL
- Defined in:
- lib/producer/core/recipe/dsl.rb
Instance Attribute Summary collapse
-
#tasks ⇒ Object
readonly
Returns the value of attribute tasks.
Class Method Summary collapse
Instance Method Summary collapse
- #evaluate(env) ⇒ Object
-
#initialize(code = nil, &block) ⇒ DSL
constructor
A new instance of DSL.
Constructor Details
#initialize(code = nil, &block) ⇒ DSL
Returns a new instance of DSL.
12 13 14 15 16 |
# File 'lib/producer/core/recipe/dsl.rb', line 12 def initialize(code = nil, &block) @code = code @block = block @tasks = [] end |
Instance Attribute Details
#tasks ⇒ Object (readonly)
Returns the value of attribute tasks.
5 6 7 |
# File 'lib/producer/core/recipe/dsl.rb', line 5 def tasks @tasks end |
Class Method Details
Instance Method Details
#evaluate(env) ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'lib/producer/core/recipe/dsl.rb', line 18 def evaluate(env) @env = env if @code instance_eval @code else instance_eval &@block end self end |