Module: Altertable

Defined in:
lib/altertable.rb,
lib/altertable/client.rb,
lib/altertable/errors.rb,
lib/altertable/version.rb,
lib/altertable/adapters.rb,
sig/altertable.rbs,
sig/altertable/client.rbs,
sig/altertable/errors.rbs,
sig/altertable/version.rbs,
sig/altertable/adapters.rbs

Defined Under Namespace

Modules: Adapters Classes: AltertableError, ApiError, Client, ConfigurationError, NetworkError

Constant Summary collapse

VERSION =

Returns:

  • (String)
"1.2.0"

Class Method Summary collapse

Class Method Details

.alias(distinct_id, new_user_id, **options) ⇒ Object

Parameters:

  • distinct_id (String)
  • new_user_id (String)
  • options (Object)

Returns:

  • (Object)


21
22
23
# File 'lib/altertable.rb', line 21

def alias(distinct_id, new_user_id, **options)
  client.alias(distinct_id, new_user_id, **options)
end

.clientClient

Returns:

Raises:



25
26
27
28
29
# File 'lib/altertable.rb', line 25

def client
  raise ConfigurationError, "Altertable client not initialized. Call Altertable.init(api_key) first." unless @client

  @client
end

.identify(user_id, **options) ⇒ Object

Parameters:

  • user_id (String)
  • options (Object)

Returns:

  • (Object)


17
18
19
# File 'lib/altertable.rb', line 17

def identify(user_id, **options)
  client.identify(user_id, **options)
end

.init(api_key, options = {}) ⇒ Client

Parameters:

  • api_key (String)
  • options (::Hash[Symbol, untyped]) (defaults to: {})

Returns:



9
10
11
# File 'lib/altertable.rb', line 9

def init(api_key, options = {})
  @client = Client.new(api_key, options)
end

.track(event, distinct_id, **options) ⇒ Object

Parameters:

  • event (String)
  • distinct_id (String)
  • options (Object)

Returns:

  • (Object)


13
14
15
# File 'lib/altertable.rb', line 13

def track(event, distinct_id, **options)
  client.track(event, distinct_id, **options)
end