Sha256: 2fe5c164317da0e3d27aa3533c00699f7f925abdf63f70d0ad45eee3af61ae59
Contents?: true
Size: 574 Bytes
Versions: 4
Compression:
Stored size: 574 Bytes
Contents
module EsHttpClient 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
4 entries across 4 versions & 1 rubygems