Class: Sequent::Core::Command
- Inherits:
-
BaseCommand
- Object
- BaseCommand
- Sequent::Core::Command
- Defined in:
- lib/sequent/core/command.rb
Overview
Most commonly used Command Command can be instantiated just by using:
Command.new(aggregate_id: "1", user_id: "joe")
But the Sequent::Core::Helpers::ParamSupport also enables Commands to be created from a params hash (like the one from Sinatra) as follows:
command = Command.from_params(params)
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ Command
constructor
A new instance of Command.
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 = {}) ⇒ Command
Returns a new instance of Command.
90 91 92 93 94 |
# File 'lib/sequent/core/command.rb', line 90 def initialize(args = {}) fail ArgumentError, 'Missing aggregate_id' if args[:aggregate_id].nil? super end |