Module: Adjust

Extended by:
Core::Configurable
Defined in:
lib/adjust.rb,
lib/adjust/version.rb,
lib/adjust/core/errors.rb,
lib/adjust/clients/base.rb,
lib/adjust/clients/event.rb,
lib/adjust/clients/revenue.rb,
lib/adjust/core/configurable.rb,
lib/adjust/transport/faraday.rb,
lib/adjust/core/configuration.rb,
lib/adjust/representers/event_representer.rb

Defined Under Namespace

Modules: Clients, Core, Representers, Transport

Constant Summary collapse

VERSION =
'0.0.1'

Class Method Summary collapse

Methods included from Core::Configurable

configuration, configure

Class Method Details

.current_timeObject



32
33
34
35
36
# File 'lib/adjust.rb', line 32

def current_time
  return Time.zone.now.iso8601 if Time.respond_to? :zone

  Time.now.utc.iso8601
end

.event(token:, time: current_time, **device) ⇒ Object



12
13
14
15
16
17
18
19
# File 'lib/adjust.rb', line 12

def event(token:, time: current_time, **device)
  Clients::Event.new \
    event_token: token,
    app_token: app_token,
    environment: environment,
    created_at: time,
    **device
end

.revenue(token:, revenue:, currency:, time: current_time, **device) ⇒ Object



21
22
23
24
25
26
27
28
29
30
# File 'lib/adjust.rb', line 21

def revenue(token:, revenue:, currency:, time: current_time, **device)
  Clients::Revenue.new \
    event_token: token,
    app_token: app_token,
    environment: environment,
    created_at: time,
    revenue: revenue,
    currency: currency,
    **device
end