Class: Userplex::Resources::Events

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

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Events

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Events.

Parameters:



33
34
35
# File 'lib/userplex/resources/events.rb', line 33

def initialize(client:)
  @client = client
end

Instance Method Details

#capture(name:, data: nil, timestamp: nil, user_id: nil, request_options: {}) ⇒ Userplex::Models::EventCaptureResponse

Capture an event

Parameters:

  • name (String)
  • data (Hash{Symbol=>Object, nil})
  • timestamp (Time)
  • user_id (String)
  • request_options (Userplex::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



19
20
21
22
23
24
25
26
27
28
# File 'lib/userplex/resources/events.rb', line 19

def capture(params)
  parsed, options = Userplex::EventCaptureParams.dump_request(params)
  @client.request(
    method: :post,
    path: "capture",
    body: parsed,
    model: Userplex::Models::EventCaptureResponse,
    options: options
  )
end