Class: CyberSourceMergedSpec::DeviceInformation16
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- CyberSourceMergedSpec::DeviceInformation16
- Defined in:
- lib/cyber_source_merged_spec/models/device_information16.rb
Overview
DeviceInformation16 Model.
Instance Attribute Summary collapse
-
#ip_address ⇒ String
IP address of the customer.
-
#network_ip_address ⇒ String
Network IP address of the customer (for example, 10.1.27).
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, network_ip_address: SKIP, additional_properties: nil) ⇒ DeviceInformation16
constructor
A new instance of DeviceInformation16.
-
#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, network_ip_address: SKIP, additional_properties: nil) ⇒ DeviceInformation16
Returns a new instance of DeviceInformation16.
45 46 47 48 49 50 51 52 53 |
# File 'lib/cyber_source_merged_spec/models/device_information16.rb', line 45 def initialize(ip_address: SKIP, network_ip_address: 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 @network_ip_address = network_ip_address unless network_ip_address == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#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_information16.rb', line 17 def ip_address @ip_address end |
#network_ip_address ⇒ String
Network IP address of the customer (for example, 10.1.27). A network IP address includes up to 256 IP addresses.
22 23 24 |
# File 'lib/cyber_source_merged_spec/models/device_information16.rb', line 22 def network_ip_address @network_ip_address end |
Class Method Details
.from_element(root) ⇒ Object
77 78 79 80 81 82 83 84 85 |
# File 'lib/cyber_source_merged_spec/models/device_information16.rb', line 77 def self.from_element(root) ip_address = XmlUtilities.from_element(root, 'ipAddress', String) network_ip_address = XmlUtilities.from_element(root, 'networkIpAddress', String) new(ip_address: ip_address, network_ip_address: network_ip_address, additional_properties: additional_properties) end |
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/cyber_source_merged_spec/models/device_information16.rb', line 56 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. ip_address = hash.key?('ipAddress') ? hash['ipAddress'] : SKIP network_ip_address = hash.key?('networkIpAddress') ? hash['networkIpAddress'] : 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. DeviceInformation16.new(ip_address: ip_address, network_ip_address: network_ip_address, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
25 26 27 28 29 30 |
# File 'lib/cyber_source_merged_spec/models/device_information16.rb', line 25 def self.names @_hash = {} if @_hash.nil? @_hash['ip_address'] = 'ipAddress' @_hash['network_ip_address'] = 'networkIpAddress' @_hash end |
.nullables ⇒ Object
An array for nullable fields
41 42 43 |
# File 'lib/cyber_source_merged_spec/models/device_information16.rb', line 41 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
33 34 35 36 37 38 |
# File 'lib/cyber_source_merged_spec/models/device_information16.rb', line 33 def self.optionals %w[ ip_address network_ip_address ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
107 108 109 110 111 |
# File 'lib/cyber_source_merged_spec/models/device_information16.rb', line 107 def inspect class_name = self.class.name.split('::').last "<#{class_name} ip_address: #{@ip_address.inspect}, network_ip_address:"\ " #{@network_ip_address.inspect}, additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
100 101 102 103 104 |
# File 'lib/cyber_source_merged_spec/models/device_information16.rb', line 100 def to_s class_name = self.class.name.split('::').last "<#{class_name} ip_address: #{@ip_address}, network_ip_address: #{@network_ip_address},"\ " additional_properties: #{@additional_properties}>" end |
#to_xml_element(doc, root_name) ⇒ Object
87 88 89 90 91 92 93 94 95 96 97 |
# File 'lib/cyber_source_merged_spec/models/device_information16.rb', line 87 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, 'networkIpAddress', network_ip_address) XmlUtilities.add_as_subelement(doc, root, 'additional_properties', additional_properties) root end |