Method: OpenapiClient::AchReturnTransaction#build_from_hash
- Defined in:
- lib/openapi_client/models/ach_return_transaction.rb
#build_from_hash(attributes, attribute_map = self.class.attribute_map, openapi_types = self.class.openapi_types) ⇒ Object
Builds the object from hash
113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 |
# File 'lib/openapi_client/models/ach_return_transaction.rb', line 113 def build_from_hash(attributes, attribute_map = self.class.attribute_map, openapi_types = self.class.openapi_types) return nil unless attributes.is_a?(Hash) super(attributes, self.class.superclass.attribute_map, self.class.superclass.openapi_types) openapi_types.each_pair do |key, type| if 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 if attributes[attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[attribute_map[key]])) end # or else data not found in attributes(hash), not an issue as the data can be optional end self end |