class Ingenico::Direct::SDK::Domain::CustomerDevice

@attr [String] accept_header @attr [Ingenico::Direct::SDK::Domain::BrowserData] browser_data @attr [String] ip_address @attr [String] locale @attr [String] timezone_offset_utc_minutes @attr [String] user_agent

Attributes

accept_header[RW]
browser_data[RW]
ip_address[RW]
locale[RW]
timezone_offset_utc_minutes[RW]
user_agent[RW]

Public Instance Methods

from_hash(hash) click to toggle source
# File lib/ingenico/direct/sdk/domain/customer_device.rb, line 37
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 = Ingenico::Direct::SDK::Domain::BrowserData.new_from_hash(hash['browserData'])
  end
  @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() click to toggle source

@return (Hash)

Calls superclass method Ingenico::Direct::SDK::DataObject#to_h
# File lib/ingenico/direct/sdk/domain/customer_device.rb, line 26
def to_h
  hash = super
  hash['acceptHeader'] = @accept_header unless @accept_header.nil?
  hash['browserData'] = @browser_data.to_h if @browser_data
  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