Module: Sift

Defined in:
lib/sift.rb,
lib/sift/client.rb,
lib/sift/version.rb

Defined Under Namespace

Classes: Client, Response

Constant Summary collapse

VERSION =
"1.1.7.3"
API_VERSION =
"203"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.api_keyObject

Returns the value of attribute api_key.



18
19
20
# File 'lib/sift.rb', line 18

def api_key
  @api_key
end

Class Method Details

.current_rest_api_pathObject

Returns the path for the current API version



7
8
9
# File 'lib/sift.rb', line 7

def self.current_rest_api_path
  "/v#{API_VERSION}/events"
end

.current_users_label_api_path(user_id) ⇒ Object



11
12
13
14
# File 'lib/sift.rb', line 11

def self.current_users_label_api_path(user_id)
  # This API version is a minor version ahead of the /events API
  "/v#{API_VERSION}/users/#{URI.encode(user_id)}/labels"
end

.error(msg) ⇒ Object



35
36
37
# File 'lib/sift.rb', line 35

def self.error(msg)
  @logger.error(msg) if @logger
end

.fatal(msg) ⇒ Object



39
40
41
# File 'lib/sift.rb', line 39

def self.fatal(msg)
  @logger.fatal(msg) if @logger
end

.info(msg) ⇒ Object



27
28
29
# File 'lib/sift.rb', line 27

def self.info(msg)
  @logger.info(msg) if @logger
end

.logger=(logger) ⇒ Object

Sets the Output logger to use within the client. This can be left uninitializaed but is useful for debugging.



23
24
25
# File 'lib/sift.rb', line 23

def self.logger=(logger)
  @logger = logger
end

.warn(msg) ⇒ Object



31
32
33
# File 'lib/sift.rb', line 31

def self.warn(msg)
  @logger.warn(msg) if @logger
end