Class: Sequent::Core::BaseCommand

Inherits:
Object
  • Object
show all
Extended by:
ActiveSupport::DescendantsTracker
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

Command, SnapshotCommand

Instance Method Summary collapse

Methods included from Helpers::TypeConversionSupport

#parse_attrs_to_correct_types

Methods included from Helpers::Copyable

#copy

Methods included from Helpers::AttributeSupport

#as_json, #attributes, #ensure_known_attributes, included, #update, #validation_errors

Methods included from Helpers::UuidHelper

new_uuid

Methods included from Helpers::EqualSupport

#==, #eql?, #hash

Methods included from Helpers::ParamSupport

#as_params, #from_params, included, #to_params

Methods included from Helpers::Mergable

#merge!

Constructor Details

#initialize(args = {}) ⇒ BaseCommand

Returns a new instance of BaseCommand.



37
38
39
40
41
42
# File 'lib/sequent/core/command.rb', line 37

def initialize(args = {})
  update_all_attributes args
  @created_at = Time.now

  _run_initialize_callbacks
end