Class: Minfraud::Components::Device
- Defined in:
- lib/minfraud/components/device.rb
Overview
Device corresponds to the device object of a minFraud request.
Instance Attribute Summary collapse
-
#accept_language ⇒ String?
The HTTP “Accept-Language” header of the browser used in the transaction.
-
#ip_address ⇒ String?
The IP address associated with the device used by the customer in the transaction.
-
#session_age ⇒ Float?
The number of seconds between the creation of the user’s session and the time of the transaction.
-
#session_id ⇒ String?
An ID that uniquely identifies a visitor’s session on the site.
-
#user_agent ⇒ String?
The HTTP “User-Agent” header of the browser used in the transaction.
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ Device
constructor
A new instance of Device.
Methods inherited from Base
Constructor Details
#initialize(params = {}) ⇒ Device
Returns a new instance of Device.
45 46 47 48 49 50 51 52 53 |
# File 'lib/minfraud/components/device.rb', line 45 def initialize(params = {}) @ip_address = params[:ip_address] @user_agent = params[:user_agent] @accept_language = params[:accept_language] @session_age = params[:session_age] @session_id = params[:session_id] validate end |
Instance Attribute Details
#accept_language ⇒ String?
The HTTP “Accept-Language” header of the browser used in the transaction.
28 29 30 |
# File 'lib/minfraud/components/device.rb', line 28 def accept_language @accept_language end |
#ip_address ⇒ String?
The IP address associated with the device used by the customer in the transaction. The IP address must be in IPv4 or IPv6 presentation format, i.e., dotted-quad notation or the IPv6 hexadecimal-colon notation.
17 18 19 |
# File 'lib/minfraud/components/device.rb', line 17 def ip_address @ip_address end |
#session_age ⇒ Float?
The number of seconds between the creation of the user’s session and the time of the transaction. Note that session_age is not the duration of the current visit, but the time since the start of the first visit. The value must be at least 0 and at most 10^13-1.
36 37 38 |
# File 'lib/minfraud/components/device.rb', line 36 def session_age @session_age end |
#session_id ⇒ String?
An ID that uniquely identifies a visitor’s session on the site.
41 42 43 |
# File 'lib/minfraud/components/device.rb', line 41 def session_id @session_id end |
#user_agent ⇒ String?
The HTTP “User-Agent” header of the browser used in the transaction.
22 23 24 |
# File 'lib/minfraud/components/device.rb', line 22 def user_agent @user_agent end |