Class: KM::Resque::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



6
7
8
9
10
11
# File 'lib/km/resque/api_client.rb', line 6

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

#api_keyObject



26
27
28
# File 'lib/km/resque/api_client.rb', line 26

def api_key
  @api_key ||= KM::Resque.configuration.key
end

#hostObject



30
31
32
# File 'lib/km/resque/api_client.rb', line 30

def host
  @host ||= KM::Resque.configuration.host
end

#portObject



34
35
36
# File 'lib/km/resque/api_client.rb', line 34

def port
  @port ||= KM::Resque.configuration.port
end

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



13
14
15
16
17
18
# File 'lib/km/resque/api_client.rb', line 13

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

#set(identifier, properties, timestamp) ⇒ Object



20
21
22
23
24
# File 'lib/km/resque/api_client.rb', line 20

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