Class: Kutils::DSLBuilder
- Inherits:
-
Object
- Object
- Kutils::DSLBuilder
- Defined in:
- lib/utils/dsl_builder.rb
Overview
DSLBuilder provides a simple DSL for configuration or scripting.
Instance Method Summary collapse
-
#initialize { ... } ⇒ DSLBuilder
constructor
A new instance of DSLBuilder.
-
#task(name) { ... } ⇒ Object
Define a task with a name and block.
Constructor Details
#initialize { ... } ⇒ DSLBuilder
Returns a new instance of DSLBuilder.
11 12 13 |
# File 'lib/utils/dsl_builder.rb', line 11 def initialize(&block) instance_eval(&block) if block_given? end |
Instance Method Details
#task(name) { ... } ⇒ Object
Define a task with a name and block
18 19 20 21 |
# File 'lib/utils/dsl_builder.rb', line 18 def task(name, &block) puts "Define task: #{name}" block.call if block_given? end |