Class: Kount::RIS::Device

Inherits:
Base
  • Object
show all
Defined in:
app/models/kount/ris/device.rb

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

Base::COUNTRY_CODES

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#browserObject

Returns the value of attribute browser.



4
5
6
# File 'app/models/kount/ris/device.rb', line 4

def browser
  @browser
end

#capturedObject 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_codeObject

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_regionObject

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_enabledObject Also known as: cookies_enabled?

Returns the value of attribute cookies_enabled.



4
5
6
# File 'app/models/kount/ris/device.rb', line 4

def cookies_enabled
  @cookies_enabled
end

#country_codeObject

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

#fingerprintObject

Returns the value of attribute fingerprint.



4
5
6
# File 'app/models/kount/ris/device.rb', line 4

def fingerprint
  @fingerprint
end

#first_seen_atObject

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_enabledObject 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_enabledObject 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_codeObject

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

#layersObject

Returns the value of attribute layers.



4
5
6
# File 'app/models/kount/ris/device.rb', line 4

def layers
  @layers
end

#localtimeObject

Returns the value of attribute localtime.



4
5
6
# File 'app/models/kount/ris/device.rb', line 4

def localtime
  @localtime
end

#mobile_typeObject

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_systemObject

Returns the value of attribute operating_system.



4
5
6
# File 'app/models/kount/ris/device.rb', line 4

def operating_system
  @operating_system
end

#regionObject

Returns the value of attribute region.



4
5
6
# File 'app/models/kount/ris/device.rb', line 4

def region
  @region
end

#remote_accessObject 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_resolutionObject

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

#timezoneObject

Returns the value of attribute timezone.



4
5
6
# File 'app/models/kount/ris/device.rb', line 4

def timezone
  @timezone
end

#user_agentObject

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_forwarderObject 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_enabledObject 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_typesObject



28
29
30
# File 'app/models/kount/ris/device.rb', line 28

def network_types
  NETWORK_TYPES
end

Instance Method Details

#mobile?Boolean

Returns:

  • (Boolean)


74
75
76
# File 'app/models/kount/ris/device.rb', line 74

def mobile?
  mobile_type.present?
end

#network_typeObject



45
46
47
# File 'app/models/kount/ris/device.rb', line 45

def network_type
  network_types[@network_type]
end

#network_type=(value) ⇒ Object

Raises:

  • (ArgumentError)


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_typesObject



33
34
35
# File 'app/models/kount/ris/device.rb', line 33

def network_types
  self.class.network_types
end

#to_hObject



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: 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: 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