Class: OnlinePayments::SDK::Domain::CustomerDevice
- Inherits:
-
OnlinePayments::SDK::DataObject
- Object
- OnlinePayments::SDK::DataObject
- OnlinePayments::SDK::Domain::CustomerDevice
- Defined in:
- lib/onlinepayments/sdk/domain/customer_device.rb
Instance Attribute Summary collapse
-
#accept_header ⇒ String
The current value of accept_header.
-
#browser_data ⇒ OnlinePayments::SDK::Domain::BrowserData
The current value of browser_data.
-
#device_fingerprint ⇒ String
The current value of device_fingerprint.
-
#ip_address ⇒ String
The current value of ip_address.
-
#locale ⇒ String
The current value of locale.
-
#timezone_offset_utc_minutes ⇒ String
The current value of timezone_offset_utc_minutes.
-
#user_agent ⇒ String
The current value of user_agent.
Instance Method Summary collapse
Methods inherited from OnlinePayments::SDK::DataObject
Instance Attribute Details
#accept_header ⇒ String
Returns the current value of accept_header.
17 18 19 |
# File 'lib/onlinepayments/sdk/domain/customer_device.rb', line 17 def accept_header @accept_header end |
#browser_data ⇒ OnlinePayments::SDK::Domain::BrowserData
Returns the current value of browser_data.
17 18 19 |
# File 'lib/onlinepayments/sdk/domain/customer_device.rb', line 17 def browser_data @browser_data end |
#device_fingerprint ⇒ String
Returns the current value of device_fingerprint.
17 18 19 |
# File 'lib/onlinepayments/sdk/domain/customer_device.rb', line 17 def device_fingerprint @device_fingerprint end |
#ip_address ⇒ String
Returns the current value of ip_address.
17 18 19 |
# File 'lib/onlinepayments/sdk/domain/customer_device.rb', line 17 def ip_address @ip_address end |
#locale ⇒ String
Returns the current value of locale.
17 18 19 |
# File 'lib/onlinepayments/sdk/domain/customer_device.rb', line 17 def locale @locale end |
#timezone_offset_utc_minutes ⇒ String
Returns the current value of timezone_offset_utc_minutes.
17 18 19 |
# File 'lib/onlinepayments/sdk/domain/customer_device.rb', line 17 def timezone_offset_utc_minutes @timezone_offset_utc_minutes end |
#user_agent ⇒ String
Returns the current value of user_agent.
17 18 19 |
# File 'lib/onlinepayments/sdk/domain/customer_device.rb', line 17 def user_agent @user_agent end |
Instance Method Details
#from_hash(hash) ⇒ Object
39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/onlinepayments/sdk/domain/customer_device.rb', line 39 def from_hash(hash) super @accept_header = hash['acceptHeader'] if hash.key? 'acceptHeader' if hash.key? 'browserData' raise TypeError, "value '%s' is not a Hash" % [hash['browserData']] unless hash['browserData'].is_a? Hash @browser_data = OnlinePayments::SDK::Domain::BrowserData.new_from_hash(hash['browserData']) end @device_fingerprint = hash['deviceFingerprint'] if hash.key? 'deviceFingerprint' @ip_address = hash['ipAddress'] if hash.key? 'ipAddress' @locale = hash['locale'] if hash.key? 'locale' @timezone_offset_utc_minutes = hash['timezoneOffsetUtcMinutes'] if hash.key? 'timezoneOffsetUtcMinutes' @user_agent = hash['userAgent'] if hash.key? 'userAgent' end |
#to_h ⇒ Hash
27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/onlinepayments/sdk/domain/customer_device.rb', line 27 def to_h hash = super hash['acceptHeader'] = @accept_header unless @accept_header.nil? hash['browserData'] = @browser_data.to_h if @browser_data hash['deviceFingerprint'] = @device_fingerprint unless @device_fingerprint.nil? hash['ipAddress'] = @ip_address unless @ip_address.nil? hash['locale'] = @locale unless @locale.nil? hash['timezoneOffsetUtcMinutes'] = @timezone_offset_utc_minutes unless @timezone_offset_utc_minutes.nil? hash['userAgent'] = @user_agent unless @user_agent.nil? hash end |