Class: Unit::Resource::EventResource
- Inherits:
-
BaseResource
- Object
- BaseResource
- Unit::Resource::EventResource
- Defined in:
- lib/unit/api_resources/event_resource.rb
Class Method Summary collapse
-
.fire(event_id) ⇒ UnitResponse, UnitError
Fire an event by calling Unit’s API.
-
.get(event_id) ⇒ UnitResponse, UnitError
Get an event by id by calling Unit’s API.
-
.list(params = nil) ⇒ UnitResponse, UnitError
List events by calling Unit’s API.
Methods inherited from BaseResource
file_response_handler, response_handler
Class Method Details
.fire(event_id) ⇒ UnitResponse, UnitError
Fire an event by calling Unit’s API
33 34 35 36 |
# File 'lib/unit/api_resources/event_resource.rb', line 33 def fire(event_id) response = HttpHelper.post("#{api_url}/events/#{event_id}", headers: headers) response_handler(response) end |
.get(event_id) ⇒ UnitResponse, UnitError
Get an event by id by calling Unit’s API
17 18 19 20 |
# File 'lib/unit/api_resources/event_resource.rb', line 17 def get(event_id) response = HttpHelper.get("#{api_url}/events/#{event_id}", headers: headers) response_handler(response) end |
.list(params = nil) ⇒ UnitResponse, UnitError
List events by calling Unit’s API
25 26 27 28 |
# File 'lib/unit/api_resources/event_resource.rb', line 25 def list(params = nil) response = HttpHelper.get("#{api_url}/events", params: params&.to_hash, headers: headers) response_handler(response) end |