Class: Yes::Core::Aggregate::Dsl::CommandGroupDefiner
- Inherits:
-
Object
- Object
- Yes::Core::Aggregate::Dsl::CommandGroupDefiner
- Defined in:
- lib/yes/core/aggregate/dsl/command_group_definer.rb
Overview
Factory class that creates and defines command_groups on aggregates.
Mirrors CommandDefiner. The DSL evaluator inside accepts two methods: ‘command :sub_command_name` to push a sub-command symbol, and `guard(name, error_extra: …) { … }` to register a group-level guard on the generated GuardEvaluator class.
Defined Under Namespace
Classes: DslEvaluator, UnknownSubCommandError
Instance Method Summary collapse
-
#call { ... } ⇒ void
Generates and registers all classes/methods for the command group.
-
#initialize(command_group_data) ⇒ CommandGroupDefiner
constructor
A new instance of CommandGroupDefiner.
Constructor Details
#initialize(command_group_data) ⇒ CommandGroupDefiner
Returns a new instance of CommandGroupDefiner.
31 32 33 |
# File 'lib/yes/core/aggregate/dsl/command_group_definer.rb', line 31 def initialize(command_group_data) @command_group_data = command_group_data end |
Instance Method Details
#call { ... } ⇒ void
This method returns an undefined value.
Generates and registers all classes/methods for the command group.
39 40 41 42 43 44 |
# File 'lib/yes/core/aggregate/dsl/command_group_definer.rb', line 39 def call(&block) create_and_register_guard_evaluator evaluate_dsl_block(&block) if block create_and_register_command define_aggregate_methods end |