Class: KmResque::ApiClient

Inherits:
Object
  • Object
show all
Defined in:
lib/km_resque/api_client.rb

Instance Method Summary collapse

Instance Method Details

#alias(identifier1, identifier2, timestamp) ⇒ Object



5
6
7
8
9
10
# File 'lib/km_resque/api_client.rb', line 5

def alias(identifier1, identifier2, timestamp)
  hit('a', { '_n' => identifier2,
             '_p' => identifier1,
             '_t' => timestamp
           })
end

#api_keyObject



25
26
27
# File 'lib/km_resque/api_client.rb', line 25

def api_key
  @api_key ||= KmResque.configuration.key
end

#hostObject



29
30
31
# File 'lib/km_resque/api_client.rb', line 29

def host
  @host ||= KmResque.configuration.host
end

#portObject



33
34
35
# File 'lib/km_resque/api_client.rb', line 33

def port
  @port ||= KmResque.configuration.port
end

#record(identifier, event_name, properties, timestamp) ⇒ Object



12
13
14
15
16
17
# File 'lib/km_resque/api_client.rb', line 12

def record(identifier, event_name, properties, timestamp)
  hit('e', { '_p' => identifier,
             '_n' => event_name,
             '_t' => timestamp
           }.merge(properties || {}))
end

#set(identifier, properties, timestamp) ⇒ Object



19
20
21
22
23
# File 'lib/km_resque/api_client.rb', line 19

def set(identifier, properties, timestamp)
  hit('s', { '_p' => identifier,
             '_t' => timestamp
           }.merge(properties))
end