class ThisData::Event

Public Class Methods

all(options={}) click to toggle source

Fetch an array of Events from the ThisData API Available options can be found at

http://help.thisdata.com/docs/v1getevents

Returns: Array of OpenStruct Event objects

# File lib/this_data/event.rb, line 11
def self.all(options={})
  response = ThisData::Client.new.get(ThisData::EVENTS_ENDPOINT, query: options)
  # Use NestedStruct to turn this Array of deep Hashes into an array of
  # OpenStructs
  response.parsed_response["results"].collect do |event_hash|
    NestedStruct.new(event_hash)
  end
end