Class: Sequent::Core::BaseCommand
- Inherits:
-
Object
- Object
- Sequent::Core::BaseCommand
- Includes:
- ActiveModel::Validations, ActiveModel::Validations::Callbacks, Helpers::AttributeSupport, Helpers::Copyable, Helpers::EqualSupport, Helpers::Mergable, Helpers::ParamSupport, Helpers::TypeConversionSupport, Helpers::UuidHelper
- Defined in:
- lib/sequent/core/command.rb
Overview
Base class for all Command’s.
Commands form the API of your domain. They are simple data objects with descriptive names of what they want to achieve. E.g. SendInvoice.
BaseCommand uses ActiveModel::Validations for validations
Direct Known Subclasses
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ BaseCommand
constructor
A new instance of BaseCommand.
Methods included from Helpers::TypeConversionSupport
Methods included from Helpers::Copyable
Methods included from Helpers::AttributeSupport
#as_json, #attributes, #ensure_known_attributes, included, #update, #validation_errors
Methods included from Helpers::UuidHelper
Methods included from Helpers::EqualSupport
Methods included from Helpers::ParamSupport
#as_params, #from_params, included, #to_params
Methods included from Helpers::Mergable
Constructor Details
#initialize(args = {}) ⇒ BaseCommand
32 33 34 35 |
# File 'lib/sequent/core/command.rb', line 32 def initialize(args = {}) update_all_attributes args @created_at = DateTime.now end |
Class Method Details
.inherited(subclass) ⇒ Object
37 38 39 |
# File 'lib/sequent/core/command.rb', line 37 def self.inherited(subclass) Commands << subclass end |