Class: Coppy::DSL

Inherits:
Object
  • Object
show all
Defined in:
lib/coppy/dsl.rb

Defined Under Namespace

Modules: Module

Instance Method Summary collapse

Constructor Details

#initializeDSL

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