Class: KondutoDevice
- Inherits:
-
Object
- Object
- KondutoDevice
- Defined in:
- lib/konduto-ruby/konduto_device.rb
Instance Attribute Summary collapse
-
#browser ⇒ Object
Returns the value of attribute browser.
-
#cookie ⇒ Object
Returns the value of attribute cookie.
-
#fingerprint ⇒ Object
Returns the value of attribute fingerprint.
-
#flash ⇒ Object
Returns the value of attribute flash.
-
#ip ⇒ Object
Returns the value of attribute ip.
-
#javascript ⇒ Object
Returns the value of attribute javascript.
-
#language ⇒ Object
Returns the value of attribute language.
-
#platform ⇒ Object
Returns the value of attribute platform.
-
#timezone ⇒ Object
Returns the value of attribute timezone.
-
#user_id ⇒ Object
Returns the value of attribute user_id.
Instance Method Summary collapse
-
#initialize(*args) ⇒ KondutoDevice
constructor
A new instance of KondutoDevice.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(*args) ⇒ KondutoDevice
Returns a new instance of KondutoDevice.
4 5 6 7 8 9 10 |
# File 'lib/konduto-ruby/konduto_device.rb', line 4 def initialize(*args) unless args[0].nil? args[0].each do |k,v| instance_variable_set("@#{k}", v) unless v.nil? end end end |
Instance Attribute Details
#browser ⇒ Object
Returns the value of attribute browser.
2 3 4 |
# File 'lib/konduto-ruby/konduto_device.rb', line 2 def browser @browser end |
#cookie ⇒ Object
Returns the value of attribute cookie.
2 3 4 |
# File 'lib/konduto-ruby/konduto_device.rb', line 2 def @cookie end |
#fingerprint ⇒ Object
Returns the value of attribute fingerprint.
2 3 4 |
# File 'lib/konduto-ruby/konduto_device.rb', line 2 def fingerprint @fingerprint end |
#flash ⇒ Object
Returns the value of attribute flash.
2 3 4 |
# File 'lib/konduto-ruby/konduto_device.rb', line 2 def flash @flash end |
#ip ⇒ Object
Returns the value of attribute ip.
2 3 4 |
# File 'lib/konduto-ruby/konduto_device.rb', line 2 def ip @ip end |
#javascript ⇒ Object
Returns the value of attribute javascript.
2 3 4 |
# File 'lib/konduto-ruby/konduto_device.rb', line 2 def javascript @javascript end |
#language ⇒ Object
Returns the value of attribute language.
2 3 4 |
# File 'lib/konduto-ruby/konduto_device.rb', line 2 def language @language end |
#platform ⇒ Object
Returns the value of attribute platform.
2 3 4 |
# File 'lib/konduto-ruby/konduto_device.rb', line 2 def platform @platform end |
#timezone ⇒ Object
Returns the value of attribute timezone.
2 3 4 |
# File 'lib/konduto-ruby/konduto_device.rb', line 2 def timezone @timezone end |
#user_id ⇒ Object
Returns the value of attribute user_id.
2 3 4 |
# File 'lib/konduto-ruby/konduto_device.rb', line 2 def user_id @user_id end |
Instance Method Details
#to_hash ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/konduto-ruby/konduto_device.rb', line 12 def to_hash hash = { user_id: self.user_id, fingerprint: self.fingerprint, platform: self.platform, browser: self.browser, language: self.language, timezone: self.timezone, cookie: self., javascript: self.javascript, flash: self.flash, ip: self.ip } KondutoUtils.remove_nil_keys_from_hash(hash) end |
#to_json ⇒ Object
28 29 30 |
# File 'lib/konduto-ruby/konduto_device.rb', line 28 def to_json self.to_hash.to_json end |