Class: OnlinePayments::SDK::Domain::CustomerDevice

Inherits:
DataObject
  • Object
show all
Defined in:
lib/onlinepayments/sdk/domain/customer_device.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from DataObject

new_from_hash

Instance Attribute Details

#accept_headerString

Returns the current value of accept_header.

Returns:

  • (String)

    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_dataOnlinePayments::SDK::Domain::BrowserData

Returns the current value of browser_data.

Returns:



17
18
19
# File 'lib/onlinepayments/sdk/domain/customer_device.rb', line 17

def browser_data
  @browser_data
end

#device_fingerprintString

Returns the current value of device_fingerprint.

Returns:

  • (String)

    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_addressString

Returns the current value of ip_address.

Returns:

  • (String)

    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

#localeString

Returns the current value of locale.

Returns:

  • (String)

    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_minutesString

Returns the current value of timezone_offset_utc_minutes.

Returns:

  • (String)

    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_agentString

Returns the current value of user_agent.

Returns:

  • (String)

    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



46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/onlinepayments/sdk/domain/customer_device.rb', line 46

def from_hash(hash)
  super
  if hash.has_key? 'acceptHeader'
    @accept_header = hash['acceptHeader']
  end
  if hash.has_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
  if hash.has_key? 'deviceFingerprint'
    @device_fingerprint = hash['deviceFingerprint']
  end
  if hash.has_key? 'ipAddress'
    @ip_address = hash['ipAddress']
  end
  if hash.has_key? 'locale'
    @locale = hash['locale']
  end
  if hash.has_key? 'timezoneOffsetUtcMinutes'
    @timezone_offset_utc_minutes = hash['timezoneOffsetUtcMinutes']
  end
  if hash.has_key? 'userAgent'
    @user_agent = hash['userAgent']
  end
end

#to_hHash

Returns:

  • (Hash)


34
35
36
37
38
39
40
41
42
43
44
# File 'lib/onlinepayments/sdk/domain/customer_device.rb', line 34

def to_h
  hash = super
  hash['acceptHeader'] = @accept_header unless @accept_header.nil?
  hash['browserData'] = @browser_data.to_h unless @browser_data.nil?
  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