Class: HammerCLI::Output::Dsl
- Inherits:
-
Object
- Object
- HammerCLI::Output::Dsl
- Defined in:
- lib/hammer_cli/output/dsl.rb
Instance Method Summary collapse
- #build(&block) ⇒ Object
- #fields ⇒ Object
-
#initialize(options = {}) ⇒ Dsl
constructor
A new instance of Dsl.
Constructor Details
#initialize(options = {}) ⇒ Dsl
Returns a new instance of Dsl.
5 6 7 |
# File 'lib/hammer_cli/output/dsl.rb', line 5 def initialize(={}) @current_path = [:path] || [] end |
Instance Method Details
#build(&block) ⇒ Object
14 15 16 |
# File 'lib/hammer_cli/output/dsl.rb', line 14 def build(&block) self.instance_eval(&block) end |
#fields ⇒ Object
9 10 11 12 |
# File 'lib/hammer_cli/output/dsl.rb', line 9 def fields @fields ||= [] @fields end |