Sha256: 9531ed2692302c76196c2702fef51513caaeaf94aacdb8702952787dfcd17d96
Contents?: true
Size: 1.07 KB
Versions: 6
Compression:
Stored size: 1.07 KB
Contents
module Klaviyo module Event module ApiOperations Result = Struct.new(:response) do def success? response.to_s == '1' end end def track(client:, event_name:, customer_properties:, properties: {}, time: nil) res = client.conn.get( '/api/track', client.build_params( event: event_name, customer_properties: customer_properties, properties: properties, time: time ) ) Result.new(res.body) end def track_once(client:, event_name:, customer_properties:, properties: {}, time: nil) res = client.conn.get( '/api/track-once', client.build_params( event: event_name, customer_properties: customer_properties, properties: properties, time: time ) ) Result.new(res.body) end end extend ApiOperations end end
Version data entries
6 entries across 6 versions & 1 rubygems