Sha256: 8d169f42cecb228ecae7fde95634e1860cc7f598ea51eb92cdd2173ed48a62d5
Contents?: true
Size: 590 Bytes
Versions: 12
Compression:
Stored size: 590 Bytes
Contents
require 'json' module EsReadModel class Event < Struct.new(:id, :type, :data, :updated, :number, :uri, :stream_id) 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 def occurred_at data[:occurredAt] end private def initialize(id, type, data, updated=nil, number=nil, uri=nil, stream_id=nil) super end end end
Version data entries
12 entries across 12 versions & 1 rubygems