Class: VisaAcceptanceMergedSpec::Links
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- VisaAcceptanceMergedSpec::Links
- Defined in:
- lib/visa_acceptance_merged_spec/models/links.rb
Overview
Links Model.
Instance Attribute Summary collapse
-
#capture ⇒ Capture
TODO: Write general description for this method.
-
#customer ⇒ Customer1
TODO: Write general description for this method.
-
#instrument_identifier ⇒ InstrumentIdentifier1
TODO: Write general description for this method.
-
#mself ⇒ Self
TODO: Write general description for this method.
-
#payment_instrument ⇒ PaymentInstrument2
TODO: Write general description for this method.
-
#reversal ⇒ Reversal1
TODO: Write general description for this method.
-
#shipping_address ⇒ ShippingAddress2
TODO: Write general description for this method.
Class Method Summary collapse
-
.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(mself: SKIP, reversal: SKIP, capture: SKIP, customer: SKIP, payment_instrument: SKIP, shipping_address: SKIP, instrument_identifier: SKIP, additional_properties: nil) ⇒ Links
constructor
A new instance of Links.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the 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(mself: SKIP, reversal: SKIP, capture: SKIP, customer: SKIP, payment_instrument: SKIP, shipping_address: SKIP, instrument_identifier: SKIP, additional_properties: nil) ⇒ Links
Returns a new instance of Links.
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/visa_acceptance_merged_spec/models/links.rb', line 71 def initialize(mself: SKIP, reversal: SKIP, capture: SKIP, customer: SKIP, payment_instrument: SKIP, shipping_address: SKIP, instrument_identifier: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @mself = mself unless mself == SKIP @reversal = reversal unless reversal == SKIP @capture = capture unless capture == SKIP @customer = customer unless customer == SKIP @payment_instrument = payment_instrument unless payment_instrument == SKIP @shipping_address = shipping_address unless shipping_address == SKIP @instrument_identifier = instrument_identifier unless instrument_identifier == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#capture ⇒ Capture
TODO: Write general description for this method
22 23 24 |
# File 'lib/visa_acceptance_merged_spec/models/links.rb', line 22 def capture @capture end |
#customer ⇒ Customer1
TODO: Write general description for this method
26 27 28 |
# File 'lib/visa_acceptance_merged_spec/models/links.rb', line 26 def customer @customer end |
#instrument_identifier ⇒ InstrumentIdentifier1
TODO: Write general description for this method
38 39 40 |
# File 'lib/visa_acceptance_merged_spec/models/links.rb', line 38 def instrument_identifier @instrument_identifier end |
#mself ⇒ Self
TODO: Write general description for this method
14 15 16 |
# File 'lib/visa_acceptance_merged_spec/models/links.rb', line 14 def mself @mself end |
#payment_instrument ⇒ PaymentInstrument2
TODO: Write general description for this method
30 31 32 |
# File 'lib/visa_acceptance_merged_spec/models/links.rb', line 30 def payment_instrument @payment_instrument end |
#reversal ⇒ Reversal1
TODO: Write general description for this method
18 19 20 |
# File 'lib/visa_acceptance_merged_spec/models/links.rb', line 18 def reversal @reversal end |
#shipping_address ⇒ ShippingAddress2
TODO: Write general description for this method
34 35 36 |
# File 'lib/visa_acceptance_merged_spec/models/links.rb', line 34 def shipping_address @shipping_address end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 |
# File 'lib/visa_acceptance_merged_spec/models/links.rb', line 88 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. mself = Self.from_hash(hash['self']) if hash['self'] reversal = Reversal1.from_hash(hash['reversal']) if hash['reversal'] capture = Capture.from_hash(hash['capture']) if hash['capture'] customer = Customer1.from_hash(hash['customer']) if hash['customer'] payment_instrument = PaymentInstrument2.from_hash(hash['paymentInstrument']) if hash['paymentInstrument'] shipping_address = ShippingAddress2.from_hash(hash['shippingAddress']) if hash['shippingAddress'] instrument_identifier = InstrumentIdentifier1.from_hash(hash['instrumentIdentifier']) if hash['instrumentIdentifier'] # 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. Links.new(mself: mself, reversal: reversal, capture: capture, customer: customer, payment_instrument: payment_instrument, shipping_address: shipping_address, instrument_identifier: instrument_identifier, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/visa_acceptance_merged_spec/models/links.rb', line 41 def self.names @_hash = {} if @_hash.nil? @_hash['mself'] = 'self' @_hash['reversal'] = 'reversal' @_hash['capture'] = 'capture' @_hash['customer'] = 'customer' @_hash['payment_instrument'] = 'paymentInstrument' @_hash['shipping_address'] = 'shippingAddress' @_hash['instrument_identifier'] = 'instrumentIdentifier' @_hash end |
.nullables ⇒ Object
An array for nullable fields
67 68 69 |
# File 'lib/visa_acceptance_merged_spec/models/links.rb', line 67 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/visa_acceptance_merged_spec/models/links.rb', line 54 def self.optionals %w[ mself reversal capture customer payment_instrument shipping_address instrument_identifier ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
131 132 133 134 135 136 137 138 |
# File 'lib/visa_acceptance_merged_spec/models/links.rb', line 131 def inspect class_name = self.class.name.split('::').last "<#{class_name} mself: #{@mself.inspect}, reversal: #{@reversal.inspect}, capture:"\ " #{@capture.inspect}, customer: #{@customer.inspect}, payment_instrument:"\ " #{@payment_instrument.inspect}, shipping_address: #{@shipping_address.inspect},"\ " instrument_identifier: #{@instrument_identifier.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
122 123 124 125 126 127 128 |
# File 'lib/visa_acceptance_merged_spec/models/links.rb', line 122 def to_s class_name = self.class.name.split('::').last "<#{class_name} mself: #{@mself}, reversal: #{@reversal}, capture: #{@capture}, customer:"\ " #{@customer}, payment_instrument: #{@payment_instrument}, shipping_address:"\ " #{@shipping_address}, instrument_identifier: #{@instrument_identifier},"\ " additional_properties: #{@additional_properties}>" end |