class SimpleEventSourcing::Events::Event

Attributes

aggregate_id[R]
occurred_on[R]

Public Class Methods

new(args) click to toggle source
# File lib/simple_event_sourcing/events/event.rb, line 9
def initialize(args)
  @aggregate_id = args[:aggregate_id]
  @occurred_on ||= Time.now.getlocal("+02:00").to_i
end

Public Instance Methods

serialize() click to toggle source
# File lib/simple_event_sourcing/events/event.rb, line 14
def serialize
  {"aggregate_id" => aggregate_id, "occurred_on" => occurred_on }
end
to_json(*a) click to toggle source
# File lib/simple_event_sourcing/events/event.rb, line 18
def to_json(*a)
  serialize.to_json(*a)
end