Class: ThePlaidApi::PayrollIncomeRateOfPay
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ThePlaidApi::PayrollIncomeRateOfPay
- Defined in:
- lib/the_plaid_api/models/payroll_income_rate_of_pay.rb
Overview
An object representing the rate at which an individual is paid.
Instance Attribute Summary collapse
-
#pay_amount ⇒ Float
The amount at which an employee is paid.
-
#pay_rate ⇒ String
The rate at which an employee 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(pay_rate: SKIP, pay_amount: SKIP, additional_properties: nil) ⇒ PayrollIncomeRateOfPay
constructor
A new instance of PayrollIncomeRateOfPay.
-
#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(pay_rate: SKIP, pay_amount: SKIP, additional_properties: nil) ⇒ PayrollIncomeRateOfPay
Returns a new instance of PayrollIncomeRateOfPay.
44 45 46 47 48 49 50 51 |
# File 'lib/the_plaid_api/models/payroll_income_rate_of_pay.rb', line 44 def initialize(pay_rate: SKIP, pay_amount: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @pay_rate = pay_rate unless pay_rate == SKIP @pay_amount = pay_amount unless pay_amount == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#pay_amount ⇒ Float
The amount at which an employee is paid.
18 19 20 |
# File 'lib/the_plaid_api/models/payroll_income_rate_of_pay.rb', line 18 def pay_amount @pay_amount end |
#pay_rate ⇒ String
The rate at which an employee is paid.
14 15 16 |
# File 'lib/the_plaid_api/models/payroll_income_rate_of_pay.rb', line 14 def pay_rate @pay_rate end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/the_plaid_api/models/payroll_income_rate_of_pay.rb', line 54 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. pay_rate = hash.key?('pay_rate') ? hash['pay_rate'] : SKIP pay_amount = hash.key?('pay_amount') ? hash['pay_amount'] : 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. PayrollIncomeRateOfPay.new(pay_rate: pay_rate, pay_amount: pay_amount, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
21 22 23 24 25 26 |
# File 'lib/the_plaid_api/models/payroll_income_rate_of_pay.rb', line 21 def self.names @_hash = {} if @_hash.nil? @_hash['pay_rate'] = 'pay_rate' @_hash['pay_amount'] = 'pay_amount' @_hash end |
.nullables ⇒ Object
An array for nullable fields
37 38 39 40 41 42 |
# File 'lib/the_plaid_api/models/payroll_income_rate_of_pay.rb', line 37 def self.nullables %w[ pay_rate pay_amount ] end |
.optionals ⇒ Object
An array for optional fields
29 30 31 32 33 34 |
# File 'lib/the_plaid_api/models/payroll_income_rate_of_pay.rb', line 29 def self.optionals %w[ pay_rate pay_amount ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
82 83 84 85 86 |
# File 'lib/the_plaid_api/models/payroll_income_rate_of_pay.rb', line 82 def inspect class_name = self.class.name.split('::').last "<#{class_name} pay_rate: #{@pay_rate.inspect}, pay_amount: #{@pay_amount.inspect},"\ " additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
75 76 77 78 79 |
# File 'lib/the_plaid_api/models/payroll_income_rate_of_pay.rb', line 75 def to_s class_name = self.class.name.split('::').last "<#{class_name} pay_rate: #{@pay_rate}, pay_amount: #{@pay_amount}, additional_properties:"\ " #{@additional_properties}>" end |