Class: Coppy::DSL
- Inherits:
-
Object
- Object
- Coppy::DSL
- Defined in:
- lib/coppy/dsl.rb
Defined Under Namespace
Modules: Module
Instance Method Summary collapse
- #add_step(name, step_class = nil, &block) ⇒ Object
-
#initialize ⇒ DSL
constructor
A new instance of DSL.
- #step(name) ⇒ Object
Constructor Details
#initialize ⇒ DSL
Returns a new instance of DSL.
5 6 7 |
# File 'lib/coppy/dsl.rb', line 5 def initialize @steps = {} end |
Instance Method Details
#add_step(name, step_class = nil, &block) ⇒ Object
13 14 15 16 |
# File 'lib/coppy/dsl.rb', line 13 def add_step(name, step_class = nil, &block) raise "Cannot define DSL step with both block and class" if step_class && block steps[name] = step_class || Steps::Base.wrap(&block) end |
#step(name) ⇒ Object
9 10 11 |
# File 'lib/coppy/dsl.rb', line 9 def step(name) steps[name] end |