Class: Polar::Resources::Events
- Defined in:
- lib/polar/resources/events.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#get(id) ⇒ Hash
Get an event by ID.
-
#ingest(events) ⇒ Hash
Ingest events.
-
#list(params = {}) ⇒ PaginatedResponse
List events.
-
#list_names(params = {}) ⇒ Array
List event names.
Methods inherited from Base
Constructor Details
This class inherits a constructor from Polar::Resources::Base
Instance Method Details
#get(id) ⇒ Hash
Get an event by ID
30 31 32 33 |
# File 'lib/polar/resources/events.rb', line 30 def get(id) response = get("/events/#{id}") response.body end |
#ingest(events) ⇒ Hash
Ingest events
38 39 40 41 42 |
# File 'lib/polar/resources/events.rb', line 38 def ingest(events) body = { events: events } response = post('/events/', body) response.body end |
#list(params = {}) ⇒ PaginatedResponse
List events
15 16 17 |
# File 'lib/polar/resources/events.rb', line 15 def list(params = {}) paginate('/events/', params) end |
#list_names(params = {}) ⇒ Array
List event names
22 23 24 25 |
# File 'lib/polar/resources/events.rb', line 22 def list_names(params = {}) response = get('/events/names', params) response.body end |