Class: ThePlaidApi::PlatformIds
- Defined in:
- lib/the_plaid_api/models/platform_ids.rb
Overview
An object containing a set of ids related to an employee
Instance Attribute Summary collapse
-
#employee_id ⇒ String
The ID of an employee as given by their employer.
-
#payroll_id ⇒ String
The ID of an employee as given by their payroll.
-
#position_id ⇒ String
The ID of the position of the employee.
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(employee_id: SKIP, payroll_id: SKIP, position_id: SKIP, additional_properties: nil) ⇒ PlatformIds
constructor
A new instance of PlatformIds.
-
#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(employee_id: SKIP, payroll_id: SKIP, position_id: SKIP, additional_properties: nil) ⇒ PlatformIds
Returns a new instance of PlatformIds.
51 52 53 54 55 56 57 58 59 60 |
# File 'lib/the_plaid_api/models/platform_ids.rb', line 51 def initialize(employee_id: SKIP, payroll_id: SKIP, position_id: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @employee_id = employee_id unless employee_id == SKIP @payroll_id = payroll_id unless payroll_id == SKIP @position_id = position_id unless position_id == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#employee_id ⇒ String
The ID of an employee as given by their employer
14 15 16 |
# File 'lib/the_plaid_api/models/platform_ids.rb', line 14 def employee_id @employee_id end |
#payroll_id ⇒ String
The ID of an employee as given by their payroll
18 19 20 |
# File 'lib/the_plaid_api/models/platform_ids.rb', line 18 def payroll_id @payroll_id end |
#position_id ⇒ String
The ID of the position of the employee
22 23 24 |
# File 'lib/the_plaid_api/models/platform_ids.rb', line 22 def position_id @position_id end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/the_plaid_api/models/platform_ids.rb', line 63 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. employee_id = hash.key?('employee_id') ? hash['employee_id'] : SKIP payroll_id = hash.key?('payroll_id') ? hash['payroll_id'] : SKIP position_id = hash.key?('position_id') ? hash['position_id'] : SKIP # 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. PlatformIds.new(employee_id: employee_id, payroll_id: payroll_id, position_id: position_id, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
25 26 27 28 29 30 31 |
# File 'lib/the_plaid_api/models/platform_ids.rb', line 25 def self.names @_hash = {} if @_hash.nil? @_hash['employee_id'] = 'employee_id' @_hash['payroll_id'] = 'payroll_id' @_hash['position_id'] = 'position_id' @_hash end |
.nullables ⇒ Object
An array for nullable fields
43 44 45 46 47 48 49 |
# File 'lib/the_plaid_api/models/platform_ids.rb', line 43 def self.nullables %w[ employee_id payroll_id position_id ] end |
.optionals ⇒ Object
An array for optional fields
34 35 36 37 38 39 40 |
# File 'lib/the_plaid_api/models/platform_ids.rb', line 34 def self.optionals %w[ employee_id payroll_id position_id ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
93 94 95 96 97 |
# File 'lib/the_plaid_api/models/platform_ids.rb', line 93 def inspect class_name = self.class.name.split('::').last "<#{class_name} employee_id: #{@employee_id.inspect}, payroll_id: #{@payroll_id.inspect},"\ " position_id: #{@position_id.inspect}, additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
86 87 88 89 90 |
# File 'lib/the_plaid_api/models/platform_ids.rb', line 86 def to_s class_name = self.class.name.split('::').last "<#{class_name} employee_id: #{@employee_id}, payroll_id: #{@payroll_id}, position_id:"\ " #{@position_id}, additional_properties: #{@additional_properties}>" end |