Class: CyberSourceMergedSpec::DeviceInformation18
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- CyberSourceMergedSpec::DeviceInformation18
- Defined in:
- lib/cyber_source_merged_spec/models/device_information18.rb
Overview
DeviceInformation18 Model.
Instance Attribute Summary collapse
-
#cookies_accepted ⇒ String
Whether the customer’s browser accepts cookies.
-
#host_name ⇒ String
DNS resolved hostname from
ipAddress. -
#ip_address ⇒ String
IP address of the customer.
Class Method Summary collapse
- .from_element(root) ⇒ Object
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(ip_address: SKIP, host_name: SKIP, cookies_accepted: SKIP, additional_properties: nil) ⇒ DeviceInformation18
constructor
A new instance of DeviceInformation18.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
- #to_xml_element(doc, root_name) ⇒ Object
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(ip_address: SKIP, host_name: SKIP, cookies_accepted: SKIP, additional_properties: nil) ⇒ DeviceInformation18
Returns a new instance of DeviceInformation18.
53 54 55 56 57 58 59 60 61 62 |
# File 'lib/cyber_source_merged_spec/models/device_information18.rb', line 53 def initialize(ip_address: SKIP, host_name: SKIP, cookies_accepted: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @ip_address = ip_address unless ip_address == SKIP @host_name = host_name unless host_name == SKIP @cookies_accepted = unless == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#cookies_accepted ⇒ String
Whether the customer’s browser accepts cookies. This field can contain one of the following values:
yes: The customer’s browser accepts cookies.no: The customer’s browser does not accept cookies.
28 29 30 |
# File 'lib/cyber_source_merged_spec/models/device_information18.rb', line 28 def @cookies_accepted end |
#host_name ⇒ String
DNS resolved hostname from ipAddress.
21 22 23 |
# File 'lib/cyber_source_merged_spec/models/device_information18.rb', line 21 def host_name @host_name end |
#ip_address ⇒ String
IP address of the customer.
Used by
Authorization, Capture, and Credit Optional field.
17 18 19 |
# File 'lib/cyber_source_merged_spec/models/device_information18.rb', line 17 def ip_address @ip_address end |
Class Method Details
.from_element(root) ⇒ Object
88 89 90 91 92 93 94 95 96 97 98 |
# File 'lib/cyber_source_merged_spec/models/device_information18.rb', line 88 def self.from_element(root) ip_address = XmlUtilities.from_element(root, 'ipAddress', String) host_name = XmlUtilities.from_element(root, 'hostName', String) = XmlUtilities.from_element(root, 'cookiesAccepted', String) new(ip_address: ip_address, host_name: host_name, cookies_accepted: , additional_properties: additional_properties) end |
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/cyber_source_merged_spec/models/device_information18.rb', line 65 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. ip_address = hash.key?('ipAddress') ? hash['ipAddress'] : SKIP host_name = hash.key?('hostName') ? hash['hostName'] : SKIP = hash.key?('cookiesAccepted') ? hash['cookiesAccepted'] : SKIP # Create a new hash for additional properties, removing known properties. new_hash = hash.reject { |k, _| names.value?(k) } additional_properties = APIHelper.get_additional_properties( new_hash, proc { |value| value } ) # Create object from extracted values. DeviceInformation18.new(ip_address: ip_address, host_name: host_name, cookies_accepted: , additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
31 32 33 34 35 36 37 |
# File 'lib/cyber_source_merged_spec/models/device_information18.rb', line 31 def self.names @_hash = {} if @_hash.nil? @_hash['ip_address'] = 'ipAddress' @_hash['host_name'] = 'hostName' @_hash['cookies_accepted'] = 'cookiesAccepted' @_hash end |
.nullables ⇒ Object
An array for nullable fields
49 50 51 |
# File 'lib/cyber_source_merged_spec/models/device_information18.rb', line 49 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
40 41 42 43 44 45 46 |
# File 'lib/cyber_source_merged_spec/models/device_information18.rb', line 40 def self.optionals %w[ ip_address host_name cookies_accepted ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
121 122 123 124 125 126 |
# File 'lib/cyber_source_merged_spec/models/device_information18.rb', line 121 def inspect class_name = self.class.name.split('::').last "<#{class_name} ip_address: #{@ip_address.inspect}, host_name: #{@host_name.inspect},"\ " cookies_accepted: #{@cookies_accepted.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
114 115 116 117 118 |
# File 'lib/cyber_source_merged_spec/models/device_information18.rb', line 114 def to_s class_name = self.class.name.split('::').last "<#{class_name} ip_address: #{@ip_address}, host_name: #{@host_name}, cookies_accepted:"\ " #{@cookies_accepted}, additional_properties: #{@additional_properties}>" end |
#to_xml_element(doc, root_name) ⇒ Object
100 101 102 103 104 105 106 107 108 109 110 111 |
# File 'lib/cyber_source_merged_spec/models/device_information18.rb', line 100 def to_xml_element(doc, root_name) root = doc.create_element(root_name) XmlUtilities.add_as_subelement(doc, root, 'ipAddress', ip_address) XmlUtilities.add_as_subelement(doc, root, 'hostName', host_name) XmlUtilities.add_as_subelement(doc, root, 'cookiesAccepted', ) XmlUtilities.add_as_subelement(doc, root, 'additional_properties', additional_properties) root end |