Class: ThePlaidApi::PayrollIncomeAccountData
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ThePlaidApi::PayrollIncomeAccountData
- Defined in:
- lib/the_plaid_api/models/payroll_income_account_data.rb
Overview
An object containing account level data.
Instance Attribute Summary collapse
-
#account_id ⇒ String
ID of the payroll provider account.
-
#pay_frequency ⇒ String
The frequency at which an individual is paid.
-
#rate_of_pay ⇒ PayrollIncomeRateOfPay
An object representing the rate at which an individual is paid.
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(account_id:, rate_of_pay:, pay_frequency:, additional_properties: nil) ⇒ PayrollIncomeAccountData
constructor
A new instance of PayrollIncomeAccountData.
-
#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(account_id:, rate_of_pay:, pay_frequency:, additional_properties: nil) ⇒ PayrollIncomeAccountData
Returns a new instance of PayrollIncomeAccountData.
46 47 48 49 50 51 52 53 54 55 |
# File 'lib/the_plaid_api/models/payroll_income_account_data.rb', line 46 def initialize(account_id:, rate_of_pay:, pay_frequency:, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @account_id = account_id @rate_of_pay = rate_of_pay @pay_frequency = pay_frequency @additional_properties = additional_properties end |
Instance Attribute Details
#account_id ⇒ String
ID of the payroll provider account.
14 15 16 |
# File 'lib/the_plaid_api/models/payroll_income_account_data.rb', line 14 def account_id @account_id end |
#pay_frequency ⇒ String
The frequency at which an individual is paid.
22 23 24 |
# File 'lib/the_plaid_api/models/payroll_income_account_data.rb', line 22 def pay_frequency @pay_frequency end |
#rate_of_pay ⇒ PayrollIncomeRateOfPay
An object representing the rate at which an individual is paid.
18 19 20 |
# File 'lib/the_plaid_api/models/payroll_income_account_data.rb', line 18 def rate_of_pay @rate_of_pay end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/the_plaid_api/models/payroll_income_account_data.rb', line 58 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. account_id = hash.key?('account_id') ? hash['account_id'] : nil rate_of_pay = PayrollIncomeRateOfPay.from_hash(hash['rate_of_pay']) if hash['rate_of_pay'] pay_frequency = hash.key?('pay_frequency') ? hash['pay_frequency'] : 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. PayrollIncomeAccountData.new(account_id: account_id, rate_of_pay: rate_of_pay, pay_frequency: pay_frequency, 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/payroll_income_account_data.rb', line 25 def self.names @_hash = {} if @_hash.nil? @_hash['account_id'] = 'account_id' @_hash['rate_of_pay'] = 'rate_of_pay' @_hash['pay_frequency'] = 'pay_frequency' @_hash end |
.nullables ⇒ Object
An array for nullable fields
39 40 41 42 43 44 |
# File 'lib/the_plaid_api/models/payroll_income_account_data.rb', line 39 def self.nullables %w[ account_id pay_frequency ] end |
.optionals ⇒ Object
An array for optional fields
34 35 36 |
# File 'lib/the_plaid_api/models/payroll_income_account_data.rb', line 34 def self.optionals [] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
88 89 90 91 92 93 |
# File 'lib/the_plaid_api/models/payroll_income_account_data.rb', line 88 def inspect class_name = self.class.name.split('::').last "<#{class_name} account_id: #{@account_id.inspect}, rate_of_pay: #{@rate_of_pay.inspect},"\ " pay_frequency: #{@pay_frequency.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
81 82 83 84 85 |
# File 'lib/the_plaid_api/models/payroll_income_account_data.rb', line 81 def to_s class_name = self.class.name.split('::').last "<#{class_name} account_id: #{@account_id}, rate_of_pay: #{@rate_of_pay}, pay_frequency:"\ " #{@pay_frequency}, additional_properties: #{@additional_properties}>" end |