Class: PaysecureApiDocumentationLive::PaymentMethodSuccess
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- PaysecureApiDocumentationLive::PaymentMethodSuccess
- Defined in:
- lib/paysecure_api_documentation_live/models/payment_method_success.rb
Overview
PaymentMethodSuccess Model.
Instance Attribute Summary collapse
-
#available_payment_methods ⇒ Array[String]
TODO: Write general description for this method.
-
#by_country ⇒ ByCountry
TODO: Write general description for this method.
-
#card_methods ⇒ Array[String]
TODO: Write general description for this method.
-
#country_names ⇒ CountryNames
TODO: Write general description for this method.
-
#names ⇒ Names
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(available_payment_methods:, by_country:, country_names:, names:, card_methods:, additional_properties: nil) ⇒ PaymentMethodSuccess
constructor
A new instance of PaymentMethodSuccess.
-
#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(available_payment_methods:, by_country:, country_names:, names:, card_methods:, additional_properties: nil) ⇒ PaymentMethodSuccess
Returns a new instance of PaymentMethodSuccess.
53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/paysecure_api_documentation_live/models/payment_method_success.rb', line 53 def initialize(available_payment_methods:, by_country:, country_names:, names:, card_methods:, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @available_payment_methods = available_payment_methods @by_country = by_country @country_names = country_names @names = names @card_methods = card_methods @additional_properties = additional_properties end |
Instance Attribute Details
#available_payment_methods ⇒ Array[String]
TODO: Write general description for this method
14 15 16 |
# File 'lib/paysecure_api_documentation_live/models/payment_method_success.rb', line 14 def available_payment_methods @available_payment_methods end |
#by_country ⇒ ByCountry
TODO: Write general description for this method
18 19 20 |
# File 'lib/paysecure_api_documentation_live/models/payment_method_success.rb', line 18 def by_country @by_country end |
#card_methods ⇒ Array[String]
TODO: Write general description for this method
30 31 32 |
# File 'lib/paysecure_api_documentation_live/models/payment_method_success.rb', line 30 def card_methods @card_methods end |
#country_names ⇒ CountryNames
TODO: Write general description for this method
22 23 24 |
# File 'lib/paysecure_api_documentation_live/models/payment_method_success.rb', line 22 def country_names @country_names end |
#names ⇒ Names
TODO: Write general description for this method
26 27 28 |
# File 'lib/paysecure_api_documentation_live/models/payment_method_success.rb', line 26 def names @names end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/paysecure_api_documentation_live/models/payment_method_success.rb', line 67 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. available_payment_methods = hash.key?('available_payment_methods') ? hash['available_payment_methods'] : nil by_country = ByCountry.from_hash(hash['by_country']) if hash['by_country'] country_names = CountryNames.from_hash(hash['country_names']) if hash['country_names'] names = Names.from_hash(hash['names']) if hash['names'] card_methods = hash.key?('card_methods') ? hash['card_methods'] : nil # 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. PaymentMethodSuccess.new(available_payment_methods: available_payment_methods, by_country: by_country, country_names: country_names, names: names, card_methods: card_methods, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
33 34 35 36 37 38 39 40 41 |
# File 'lib/paysecure_api_documentation_live/models/payment_method_success.rb', line 33 def self.names @_hash = {} if @_hash.nil? @_hash['available_payment_methods'] = 'available_payment_methods' @_hash['by_country'] = 'by_country' @_hash['country_names'] = 'country_names' @_hash['names'] = 'names' @_hash['card_methods'] = 'card_methods' @_hash end |
.nullables ⇒ Object
An array for nullable fields
49 50 51 |
# File 'lib/paysecure_api_documentation_live/models/payment_method_success.rb', line 49 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
44 45 46 |
# File 'lib/paysecure_api_documentation_live/models/payment_method_success.rb', line 44 def self.optionals [] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
103 104 105 106 107 108 109 |
# File 'lib/paysecure_api_documentation_live/models/payment_method_success.rb', line 103 def inspect class_name = self.class.name.split('::').last "<#{class_name} available_payment_methods: #{@available_payment_methods.inspect},"\ " by_country: #{@by_country.inspect}, country_names: #{@country_names.inspect}, names:"\ " #{@names.inspect}, card_methods: #{@card_methods.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
95 96 97 98 99 100 |
# File 'lib/paysecure_api_documentation_live/models/payment_method_success.rb', line 95 def to_s class_name = self.class.name.split('::').last "<#{class_name} available_payment_methods: #{@available_payment_methods}, by_country:"\ " #{@by_country}, country_names: #{@country_names}, names: #{@names}, card_methods:"\ " #{@card_methods}, additional_properties: #{@additional_properties}>" end |