Method: Api::BankInformation.build_from_hash
- Defined in:
- lib/jamm/api/models/v1_bank_information.rb
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 |
# File 'lib/jamm/api/models/v1_bank_information.rb', line 109 def self.build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) transformed_hash = {} openapi_types.each_pair do |key, type| if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? transformed_hash[key.to_s] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not transformed_hash[key.to_s] = attributes[attribute_map[key]].map { |v| _deserialize(::Regexp.last_match(1), v) } if attributes[attribute_map[key]].is_a?(Array) elsif !attributes[attribute_map[key]].nil? transformed_hash[key.to_s] = _deserialize(type, attributes[attribute_map[key]]) end end new(transformed_hash) end |