Class: Talis::Analytics::Event
- Defined in:
- lib/talis/analytics/event.rb
Overview
Represents an event for analytical purposes.
Class Method Summary collapse
-
.create(request_id: new_req_id, event:) ⇒ Object
Create a single analytics event.
Methods inherited from Resource
Class Method Details
.create(request_id: new_req_id, event:) ⇒ Object
Create a single analytics event. In order to send events, the client must be configured with a valid OAuth client that is allowed to search for users:
Talis::Authentication.client_id = 'client_id'
Talis::Authentication.client_secret = 'client_secret'
29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/talis/analytics/event.rb', line 29 def create(request_id: new_req_id, event:) request_id = new_req_id unless request_id validate_event event payload = whitelist_event event begin response = post_event(request_id, payload) handle_response(response, 204) rescue SocketError raise Talis::ServerCommunicationError end end |