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
59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/ripe/dsl/task_dsl.rb', line 59 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
49 50 51 |
# File 'lib/ripe/dsl/task_dsl.rb', line 49 def params @params end |
Instance Method Details
#param(key, value) ⇒ Object
Register a parameter
78 79 80 |
# File 'lib/ripe/dsl/task_dsl.rb', line 78 def param(key, value) @params.merge!({ key => value }) end |