Module: Domainic::Command Abstract
- Defined in:
- lib/domainic/command.rb,
lib/domainic/command/result.rb,
lib/domainic/command/errors/error.rb,
lib/domainic/command/class_methods.rb,
lib/domainic/command/result/status.rb,
lib/domainic/command/context/behavior.rb,
lib/domainic/command/instance_methods.rb,
lib/domainic/command/result/error_set.rb,
lib/domainic/command/context/attribute.rb,
lib/domainic/command/context/attribute_set.rb,
lib/domainic/command/context/input_context.rb,
lib/domainic/command/context/output_context.rb,
lib/domainic/command/errors/execution_error.rb,
lib/domainic/command/context/runtime_context.rb
Overview
This module is abstract.
Including classes must implement an #execute method that defines the command's business logic. The #execute method has access to validated inputs via the #context accessor and should set any output values on the context before returning.
A module that implements the Command pattern, providing a structured way to encapsulate business operations. Commands are single-purpose objects that perform a specific action, validating their inputs and outputs while maintaining a consistent interface for error handling and result reporting.
Defined Under Namespace
Modules: ClassMethods, Context, InstanceMethods Classes: Error, ExecutionError, Result
Class Method Summary collapse
Class Method Details
.included(base) ⇒ Object
71 72 73 74 75 |
# File 'lib/domainic/command.rb', line 71 def self.included(base) super base.include(InstanceMethods) base.extend(ClassMethods) end |