class SnowplowTracker::Subject
Attributes
standard_nv_pairs[R]
Public Class Methods
new()
click to toggle source
# File lib/snowplow-tracker/subject.rb, line 30 def initialize @standard_nv_pairs = {"p" => @@default_platform} self end
Public Instance Methods
set_color_depth(depth)
click to toggle source
# File lib/snowplow-tracker/subject.rb, line 83 def set_color_depth(depth) @standard_nv_pairs['cd'] = depth self end
set_domain_user_id(duid)
click to toggle source
# File lib/snowplow-tracker/subject.rb, line 107 def set_domain_user_id(duid) @standard_nv_pairs['duid'] = duid self end
set_fingerprint(fingerprint)
click to toggle source
# File lib/snowplow-tracker/subject.rb, line 59 def set_fingerprint(fingerprint) @standard_nv_pairs['fp'] = fingerprint self end
set_ip_address(ip)
click to toggle source
# File lib/snowplow-tracker/subject.rb, line 115 def set_ip_address(ip) @standard_nv_pairs['ip'] = ip self end
set_lang(lang)
click to toggle source
# File lib/snowplow-tracker/subject.rb, line 99 def set_lang(lang) @standard_nv_pairs['lang'] = lang self end
set_network_user_id(nuid)
click to toggle source
# File lib/snowplow-tracker/subject.rb, line 132 def set_network_user_id(nuid) @standard_nv_pairs['tnuid'] = nuid self end
set_platform(value)
click to toggle source
# File lib/snowplow-tracker/subject.rb, line 38 def set_platform(value) if @@supported_platforms.include?(value) @standard_nv_pairs['p'] = value else raise "#{value} is not a supported platform" end self end
set_screen_resolution(width, height)
click to toggle source
# File lib/snowplow-tracker/subject.rb, line 67 def set_screen_resolution(width, height) @standard_nv_pairs['res'] = "#{width}x#{height}" self end
set_timezone(timezone)
click to toggle source
# File lib/snowplow-tracker/subject.rb, line 91 def set_timezone(timezone) @standard_nv_pairs['tz'] = timezone self end
set_user_id(user_id)
click to toggle source
# File lib/snowplow-tracker/subject.rb, line 51 def set_user_id(user_id) @standard_nv_pairs['uid'] = user_id self end
set_useragent(ua)
click to toggle source
# File lib/snowplow-tracker/subject.rb, line 123 def set_useragent(ua) @standard_nv_pairs['ua'] = ua self end
set_viewport(width, height)
click to toggle source
# File lib/snowplow-tracker/subject.rb, line 75 def set_viewport(width, height) @standard_nv_pairs['vp'] = "#{width}x#{height}" self end