Class: ThePlaidApi::Individual
- Defined in:
- lib/the_plaid_api/models/individual.rb
Overview
Documentation not found in the MISMO model viewer and not provided by Freddie Mac.
Instance Attribute Summary collapse
-
#name ⇒ Name
Parent container for name that allows for choice group between parsed and unparsed containers.Parent container for name that allows for choice group between parsed and unparsed containers.
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(name:, additional_properties: nil) ⇒ Individual
constructor
A new instance of Individual.
-
#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(name:, additional_properties: nil) ⇒ Individual
Returns a new instance of Individual.
36 37 38 39 40 41 42 |
# File 'lib/the_plaid_api/models/individual.rb', line 36 def initialize(name:, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @name = name @additional_properties = additional_properties end |
Instance Attribute Details
#name ⇒ Name
Parent container for name that allows for choice group between parsed and unparsed containers.Parent container for name that allows for choice group between parsed and unparsed containers.
17 18 19 |
# File 'lib/the_plaid_api/models/individual.rb', line 17 def name @name end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/the_plaid_api/models/individual.rb', line 45 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. name = Name.from_hash(hash['NAME']) if hash['NAME'] # 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. Individual.new(name: name, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
20 21 22 23 24 |
# File 'lib/the_plaid_api/models/individual.rb', line 20 def self.names @_hash = {} if @_hash.nil? @_hash['name'] = 'NAME' @_hash end |
.nullables ⇒ Object
An array for nullable fields
32 33 34 |
# File 'lib/the_plaid_api/models/individual.rb', line 32 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
27 28 29 |
# File 'lib/the_plaid_api/models/individual.rb', line 27 def self.optionals [] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
70 71 72 73 |
# File 'lib/the_plaid_api/models/individual.rb', line 70 def inspect class_name = self.class.name.split('::').last "<#{class_name} name: #{@name.inspect}, additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
64 65 66 67 |
# File 'lib/the_plaid_api/models/individual.rb', line 64 def to_s class_name = self.class.name.split('::').last "<#{class_name} name: #{@name}, additional_properties: #{@additional_properties}>" end |