Class: DSLCompose::DSL::Arguments::Argument::Interpreter
- Inherits:
-
Object
- Object
- DSLCompose::DSL::Arguments::Argument::Interpreter
- Defined in:
- lib/dsl_compose/dsl/arguments/argument/interpreter.rb
Overview
This class is reponsible for parsing and executing argument definitions within our internal DSL. These argument definitions determine what arguments will be available on the methods within our new dynamic DSL.
This class is instantaited by the DSLCompose::DSL::Arguments::Argument class and the method argument definition part of our internal DSL is evaluated by passing a block to ‘instance_eval` on this class.
An example of our internal DSL which includes a method definition with complex arguments:
define_dsl :my_dsl do
add_method :my_method, required: true do
description "Description of my method"
optional :my_optional_argument, :string do
description "A description of this argument"
validate_greater_than 10
end
optional :my_optional_arg, String
end
end
Instance Method Summary collapse
-
#initialize(argument) ⇒ Interpreter
constructor
A new instance of Interpreter.
Constructor Details
#initialize(argument) ⇒ Interpreter
Returns a new instance of Interpreter.
27 28 29 |
# File 'lib/dsl_compose/dsl/arguments/argument/interpreter.rb', line 27 def initialize argument @argument = argument end |