Class: Kount::RIS::Device
Constant Summary collapse
- NETWORK_TYPES =
{ 'a' => 'Anonymous', 'h' => 'High School', 'l' => 'Library', 'n' => 'Normal', 'o' => 'Open Proxy', 'p' => 'Prison', 's' => 'Satellite', }
Constants inherited from Base
Instance Attribute Summary collapse
-
#browser ⇒ Object
Returns the value of attribute browser.
-
#captured ⇒ Object
(also: #captured?)
Returns the value of attribute captured.
-
#configured_country_code ⇒ Object
Returns the value of attribute configured_country_code.
-
#configured_region ⇒ Object
Returns the value of attribute configured_region.
-
#cookies_enabled ⇒ Object
(also: #cookies_enabled?)
Returns the value of attribute cookies_enabled.
-
#country_code ⇒ Object
Returns the value of attribute country_code.
-
#fingerprint ⇒ Object
Returns the value of attribute fingerprint.
-
#first_seen_at ⇒ Object
Returns the value of attribute first_seen_at.
-
#flash_enabled ⇒ Object
(also: #flash_enabled?)
Returns the value of attribute flash_enabled.
-
#javascript_enabled ⇒ Object
(also: #javascript_enabled?)
Returns the value of attribute javascript_enabled.
-
#language_country_code ⇒ Object
Returns the value of attribute language_country_code.
-
#layers ⇒ Object
Returns the value of attribute layers.
-
#localtime ⇒ Object
Returns the value of attribute localtime.
-
#mobile_type ⇒ Object
Returns the value of attribute mobile_type.
-
#operating_system ⇒ Object
Returns the value of attribute operating_system.
-
#region ⇒ Object
Returns the value of attribute region.
-
#remote_access ⇒ Object
(also: #remote_access?)
Returns the value of attribute remote_access.
-
#screen_resolution ⇒ Object
Returns the value of attribute screen_resolution.
-
#timezone ⇒ Object
Returns the value of attribute timezone.
-
#user_agent ⇒ Object
Returns the value of attribute user_agent.
-
#using_forwarder ⇒ Object
(also: #using_forwarder?)
Returns the value of attribute using_forwarder.
-
#voice_enabled ⇒ Object
(also: #voice_enabled?)
Returns the value of attribute voice_enabled.
Class Method Summary collapse
Instance Method Summary collapse
- #mobile? ⇒ Boolean
- #network_type ⇒ Object
- #network_type=(value) ⇒ Object
- #network_types ⇒ Object
- #to_h ⇒ Object
Instance Attribute Details
#browser ⇒ Object
Returns the value of attribute browser.
4 5 6 |
# File 'app/models/kount/ris/device.rb', line 4 def browser @browser end |
#captured ⇒ Object Also known as: captured?
Returns the value of attribute captured.
4 5 6 |
# File 'app/models/kount/ris/device.rb', line 4 def captured @captured end |
#configured_country_code ⇒ Object
Returns the value of attribute configured_country_code.
4 5 6 |
# File 'app/models/kount/ris/device.rb', line 4 def configured_country_code @configured_country_code end |
#configured_region ⇒ Object
Returns the value of attribute configured_region.
4 5 6 |
# File 'app/models/kount/ris/device.rb', line 4 def configured_region @configured_region end |
#cookies_enabled ⇒ Object Also known as:
Returns the value of attribute cookies_enabled.
4 5 6 |
# File 'app/models/kount/ris/device.rb', line 4 def end |
#country_code ⇒ Object
Returns the value of attribute country_code.
4 5 6 |
# File 'app/models/kount/ris/device.rb', line 4 def country_code @country_code end |
#fingerprint ⇒ Object
Returns the value of attribute fingerprint.
4 5 6 |
# File 'app/models/kount/ris/device.rb', line 4 def fingerprint @fingerprint end |
#first_seen_at ⇒ Object
Returns the value of attribute first_seen_at.
4 5 6 |
# File 'app/models/kount/ris/device.rb', line 4 def first_seen_at @first_seen_at end |
#flash_enabled ⇒ Object Also known as: flash_enabled?
Returns the value of attribute flash_enabled.
4 5 6 |
# File 'app/models/kount/ris/device.rb', line 4 def flash_enabled @flash_enabled end |
#javascript_enabled ⇒ Object Also known as: javascript_enabled?
Returns the value of attribute javascript_enabled.
4 5 6 |
# File 'app/models/kount/ris/device.rb', line 4 def javascript_enabled @javascript_enabled end |
#language_country_code ⇒ Object
Returns the value of attribute language_country_code.
4 5 6 |
# File 'app/models/kount/ris/device.rb', line 4 def language_country_code @language_country_code end |
#layers ⇒ Object
Returns the value of attribute layers.
4 5 6 |
# File 'app/models/kount/ris/device.rb', line 4 def layers @layers end |
#localtime ⇒ Object
Returns the value of attribute localtime.
4 5 6 |
# File 'app/models/kount/ris/device.rb', line 4 def localtime @localtime end |
#mobile_type ⇒ Object
Returns the value of attribute mobile_type.
4 5 6 |
# File 'app/models/kount/ris/device.rb', line 4 def mobile_type @mobile_type end |
#operating_system ⇒ Object
Returns the value of attribute operating_system.
4 5 6 |
# File 'app/models/kount/ris/device.rb', line 4 def end |
#region ⇒ Object
Returns the value of attribute region.
4 5 6 |
# File 'app/models/kount/ris/device.rb', line 4 def region @region end |
#remote_access ⇒ Object Also known as: remote_access?
Returns the value of attribute remote_access.
4 5 6 |
# File 'app/models/kount/ris/device.rb', line 4 def remote_access @remote_access end |
#screen_resolution ⇒ Object
Returns the value of attribute screen_resolution.
4 5 6 |
# File 'app/models/kount/ris/device.rb', line 4 def screen_resolution @screen_resolution end |
#timezone ⇒ Object
Returns the value of attribute timezone.
4 5 6 |
# File 'app/models/kount/ris/device.rb', line 4 def timezone @timezone end |
#user_agent ⇒ Object
Returns the value of attribute user_agent.
4 5 6 |
# File 'app/models/kount/ris/device.rb', line 4 def user_agent @user_agent end |
#using_forwarder ⇒ Object Also known as: using_forwarder?
Returns the value of attribute using_forwarder.
4 5 6 |
# File 'app/models/kount/ris/device.rb', line 4 def using_forwarder @using_forwarder end |
#voice_enabled ⇒ Object Also known as: voice_enabled?
Returns the value of attribute voice_enabled.
4 5 6 |
# File 'app/models/kount/ris/device.rb', line 4 def voice_enabled @voice_enabled end |
Class Method Details
.network_types ⇒ Object
28 29 30 |
# File 'app/models/kount/ris/device.rb', line 28 def network_types NETWORK_TYPES end |
Instance Method Details
#mobile? ⇒ Boolean
74 75 76 |
# File 'app/models/kount/ris/device.rb', line 74 def mobile? mobile_type.present? end |
#network_type ⇒ Object
45 46 47 |
# File 'app/models/kount/ris/device.rb', line 45 def network_type network_types[@network_type] end |
#network_type=(value) ⇒ Object
37 38 39 40 41 42 43 |
# File 'app/models/kount/ris/device.rb', line 37 def network_type=(value) return @network_type = nil if value.nil? network_type_value = network_types.detect { |k,v| k if v.downcase == value.to_s.downcase }&.first || value.to_s.downcase raise ArgumentError, "'#{value}' is not a valid network type" unless network_types.include?(network_type_value) @network_type = network_type_value end |
#network_types ⇒ Object
33 34 35 |
# File 'app/models/kount/ris/device.rb', line 33 def network_types self.class.network_types end |
#to_h ⇒ Object
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
# File 'app/models/kount/ris/device.rb', line 78 def to_h { browser: browser, cookies_enabled: , first_seen_at: first_seen_at, layers: layers, screen_resolution: screen_resolution, fingerprint: fingerprint, flash_enabled: flash_enabled, configured_country_code: configured_country_code, javascript_enabled: javascript_enabled, captured: captured, language_country_code: language_country_code, localtime: localtime, using_forwarder: using_forwarder, mobile_type: mobile_type, operating_system: , remote_access: remote_access, configured_region: configured_region, timezone: timezone, user_agent: user_agent, voice_enabled: voice_enabled, region: region, country_code: country_code, } end |