Module: UseCases::DSL
Instance Method Summary collapse
Instance Method Details
#__steps__ ⇒ Object
21 22 23 |
# File 'lib/use_cases/dsl.rb', line 21 def __steps__ @__steps__ ||= [] end |
#register_adapter(step_class) ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/use_cases/dsl.rb', line 9 def register_adapter(step_class) step_name = underscore(demodulize(step_class.name)) define_singleton_method(step_name) do |name, = {}| __steps__ << step_class.new(name, nil, ) end end |
#remove_step(name) ⇒ Object
17 18 19 |
# File 'lib/use_cases/dsl.rb', line 17 def remove_step(name) __steps__.delete_if { |step| step.name == name } end |