Class: Ripe::DSL::TaskDSL
- Inherits:
-
Object
- Object
- Ripe::DSL::TaskDSL
- Defined in:
- lib/ripe/dsl/task_dsl.rb
Overview
This class provides a DSL for defining a task. It should only be called by #task.
Instance Attribute Summary collapse
-
#params ⇒ Hash<Symbol, String>
readonly
list of parameters.
Instance Method Summary collapse
-
#initialize(handle, &block) ⇒ TaskDSL
constructor
Create a new
TaskDSL. -
#param(key, value) ⇒ Object
Register a parameter.
Constructor Details
#initialize(handle, &block) ⇒ TaskDSL
Create a new Task DSL
72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/ripe/dsl/task_dsl.rb', line 72 def initialize(handle, &block) @handle = handle @params = {} if block_given? if block.arity == 1 yield self else instance_eval &block end end end |
Instance Attribute Details
#params ⇒ Hash<Symbol, String> (readonly)
list of parameters
62 63 64 |
# File 'lib/ripe/dsl/task_dsl.rb', line 62 def params @params end |
Instance Method Details
#param(key, value) ⇒ Object
Register a parameter
91 92 93 |
# File 'lib/ripe/dsl/task_dsl.rb', line 91 def param(key, value) @params.merge!({ key => value }) end |