class EsReadModel::Event

Public Class Methods

load_from(hash) click to toggle source
# File lib/es_readmodel/event.rb, line 7
def self.load_from(hash)
  return nil unless hash['data']
  data = JSON.parse(hash['data'], symbolize_names: true)
  event = Event.new(hash['eventId'], hash['eventType'], data, hash['updated'], hash['eventNumber'].to_i, hash['id'], hash['streamId'])
  event
end
new(id, type, data, updated=nil, number=nil, uri=nil, stream_id=nil) click to toggle source
Calls superclass method
# File lib/es_readmodel/event.rb, line 20
def initialize(id, type, data, updated=nil, number=nil, uri=nil, stream_id=nil)
  super
end

Public Instance Methods

occurred_at() click to toggle source
# File lib/es_readmodel/event.rb, line 14
def occurred_at
  data[:occurredAt]
end