Module: Outbound
- Defined in:
- lib/outbound.rb
Defined Under Namespace
Modules: Defaults
Classes: Client, Result
Constant Summary
collapse
- VERSION =
'0.2.1'
- BASE_URL =
'https://api.outbound.io/v2'
- ERROR_USER_ID =
"User ID must be a string or number."
- ERROR_EVENT_NAME =
"Event name must be a string."
- ERROR_CONNECTION =
"Outbound connection error"
- ERROR_INIT =
"Must call init() before identify() or track()."
Class Method Summary
collapse
Class Method Details
.identify(user_id, info = {}, attributes = {}) ⇒ Object
33
34
35
36
37
38
39
40
41
|
# File 'lib/outbound.rb', line 33
def Outbound.identify user_id, info={}, attributes={}
if @ob == nil
res = Result.new Outbound::ERROR_INIT, false
@logger.error res.error
return res
end
return @ob.identify user_id, info, attributes
end
|
.init(api_key, log_level = Logger::ERROR) ⇒ Object
28
29
30
31
|
# File 'lib/outbound.rb', line 28
def Outbound.init api_key, log_level=Logger::ERROR
@logger.level = log_level
@ob = Outbound::Client.new api_key, @logger
end
|
.track(user_id, event, properties = {}, user_info = {}, user_attributes = {}) ⇒ Object
43
44
45
46
47
48
49
50
|
# File 'lib/outbound.rb', line 43
def Outbound.track user_id, event, properties={}, user_info={}, user_attributes={}
if @ob == nil
res = Result.new Outbound::ERROR_INIT, false
@logger.error res.error
return res
end
return @ob.track user_id, event, properties, user_info, user_attributes
end
|