class EsHttpClient::Event
Public Class Methods
load_from(hash)
click to toggle source
# File lib/es_http_client/event.rb, line 5 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_http_client/event.rb, line 18 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_http_client/event.rb, line 12 def occurred_at data[:occurredAt] end