Class: ThePlaidApi::Employer
- Defined in:
- lib/the_plaid_api/models/employer.rb
Overview
Data about the employer.
Instance Attribute Summary collapse
-
#address ⇒ AddressDataNullable
Data about the components comprising an address.
-
#confidence_score ⇒ Float
A number from 0 to 1 indicating Plaid’s level of confidence in the pairing between the employer and the institution (not yet implemented).
-
#employer_id ⇒ String
Plaid’s unique identifier for the employer.
-
#name ⇒ String
The name of the employer.
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(employer_id:, name:, address:, confidence_score:, additional_properties: nil) ⇒ Employer
constructor
A new instance of Employer.
-
#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(employer_id:, name:, address:, confidence_score:, additional_properties: nil) ⇒ Employer
Returns a new instance of Employer.
51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/the_plaid_api/models/employer.rb', line 51 def initialize(employer_id:, name:, address:, confidence_score:, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @employer_id = employer_id @name = name @address = address @confidence_score = confidence_score @additional_properties = additional_properties end |
Instance Attribute Details
#address ⇒ AddressDataNullable
Data about the components comprising an address.
22 23 24 |
# File 'lib/the_plaid_api/models/employer.rb', line 22 def address @address end |
#confidence_score ⇒ Float
A number from 0 to 1 indicating Plaid’s level of confidence in the pairing between the employer and the institution (not yet implemented).
27 28 29 |
# File 'lib/the_plaid_api/models/employer.rb', line 27 def confidence_score @confidence_score end |
#employer_id ⇒ String
Plaid’s unique identifier for the employer.
14 15 16 |
# File 'lib/the_plaid_api/models/employer.rb', line 14 def employer_id @employer_id end |
#name ⇒ String
The name of the employer
18 19 20 |
# File 'lib/the_plaid_api/models/employer.rb', line 18 def name @name end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/the_plaid_api/models/employer.rb', line 64 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. employer_id = hash.key?('employer_id') ? hash['employer_id'] : nil name = hash.key?('name') ? hash['name'] : nil address = AddressDataNullable.from_hash(hash['address']) if hash['address'] confidence_score = hash.key?('confidence_score') ? hash['confidence_score'] : 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. Employer.new(employer_id: employer_id, name: name, address: address, confidence_score: confidence_score, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
30 31 32 33 34 35 36 37 |
# File 'lib/the_plaid_api/models/employer.rb', line 30 def self.names @_hash = {} if @_hash.nil? @_hash['employer_id'] = 'employer_id' @_hash['name'] = 'name' @_hash['address'] = 'address' @_hash['confidence_score'] = 'confidence_score' @_hash end |
.nullables ⇒ Object
An array for nullable fields
45 46 47 48 49 |
# File 'lib/the_plaid_api/models/employer.rb', line 45 def self.nullables %w[ address ] end |
.optionals ⇒ Object
An array for optional fields
40 41 42 |
# File 'lib/the_plaid_api/models/employer.rb', line 40 def self.optionals [] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
97 98 99 100 101 102 |
# File 'lib/the_plaid_api/models/employer.rb', line 97 def inspect class_name = self.class.name.split('::').last "<#{class_name} employer_id: #{@employer_id.inspect}, name: #{@name.inspect}, address:"\ " #{@address.inspect}, confidence_score: #{@confidence_score.inspect},"\ " additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
90 91 92 93 94 |
# File 'lib/the_plaid_api/models/employer.rb', line 90 def to_s class_name = self.class.name.split('::').last "<#{class_name} employer_id: #{@employer_id}, name: #{@name}, address: #{@address},"\ " confidence_score: #{@confidence_score}, additional_properties: #{@additional_properties}>" end |