Class: PersonaApi::EventsResource

Inherits:
Resource
  • Object
show all
Defined in:
lib/persona_api/resources/events.rb

Instance Attribute Summary

Attributes inherited from Resource

#client

Instance Method Summary collapse

Methods inherited from Resource

#delete_request, #get_request, #handle_response, #initialize, #patch_request, #post_request, #put_request

Constructor Details

This class inherits a constructor from PersonaApi::Resource

Instance Method Details

#list(**params) ⇒ Object



3
4
5
# File 'lib/persona_api/resources/events.rb', line 3

def list(**params)
  Collection.from_response get_request("events", params: params), key: "data", type: Event
end

#retrieve(evt_id:) ⇒ Object



7
8
9
# File 'lib/persona_api/resources/events.rb', line 7

def retrieve(evt_id:)
  Event.new get_request("events/#{evt_id}").body.dig("data")
end