Class: ThePlaidApi::PayStubEarningsBreakdown
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ThePlaidApi::PayStubEarningsBreakdown
- Defined in:
- lib/the_plaid_api/models/pay_stub_earnings_breakdown.rb
Overview
An object representing the earnings line items for the pay period.
Instance Attribute Summary collapse
-
#canonical_description ⇒ String
Commonly used term to describe the earning line item.
-
#current_amount ⇒ Float
Raw amount of the earning line item.
-
#description ⇒ String
Description of the earning line item.
-
#hours ⇒ Float
Number of hours applicable for this earning.
-
#iso_currency_code ⇒ String
The ISO-4217 currency code of the line item.
-
#rate ⇒ Float
Hourly rate applicable for this earning.
-
#unofficial_currency_code ⇒ String
The unofficial currency code associated with the line item.
-
#ytd_amount ⇒ Float
The year-to-date amount of the deduction.
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(canonical_description:, current_amount:, description:, hours:, iso_currency_code:, rate:, unofficial_currency_code:, ytd_amount:, additional_properties: nil) ⇒ PayStubEarningsBreakdown
constructor
A new instance of PayStubEarningsBreakdown.
-
#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(canonical_description:, current_amount:, description:, hours:, iso_currency_code:, rate:, unofficial_currency_code:, ytd_amount:, additional_properties: nil) ⇒ PayStubEarningsBreakdown
Returns a new instance of PayStubEarningsBreakdown.
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
# File 'lib/the_plaid_api/models/pay_stub_earnings_breakdown.rb', line 84 def initialize(canonical_description:, current_amount:, description:, hours:, iso_currency_code:, rate:, unofficial_currency_code:, ytd_amount:, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @canonical_description = canonical_description @current_amount = current_amount @description = description @hours = hours @iso_currency_code = iso_currency_code @rate = rate @unofficial_currency_code = unofficial_currency_code @ytd_amount = ytd_amount @additional_properties = additional_properties end |
Instance Attribute Details
#canonical_description ⇒ String
Commonly used term to describe the earning line item.
14 15 16 |
# File 'lib/the_plaid_api/models/pay_stub_earnings_breakdown.rb', line 14 def canonical_description @canonical_description end |
#current_amount ⇒ Float
Raw amount of the earning line item.
18 19 20 |
# File 'lib/the_plaid_api/models/pay_stub_earnings_breakdown.rb', line 18 def current_amount @current_amount end |
#description ⇒ String
Description of the earning line item.
22 23 24 |
# File 'lib/the_plaid_api/models/pay_stub_earnings_breakdown.rb', line 22 def description @description end |
#hours ⇒ Float
Number of hours applicable for this earning.
26 27 28 |
# File 'lib/the_plaid_api/models/pay_stub_earnings_breakdown.rb', line 26 def hours @hours end |
#iso_currency_code ⇒ String
The ISO-4217 currency code of the line item. Always ‘null` if `unofficial_currency_code` is non-null.
31 32 33 |
# File 'lib/the_plaid_api/models/pay_stub_earnings_breakdown.rb', line 31 def iso_currency_code @iso_currency_code end |
#rate ⇒ Float
Hourly rate applicable for this earning.
35 36 37 |
# File 'lib/the_plaid_api/models/pay_stub_earnings_breakdown.rb', line 35 def rate @rate end |
#unofficial_currency_code ⇒ String
The unofficial currency code associated with the line item. Always ‘null` if `iso_currency_code` is non-`null`. Unofficial currency codes are used for currencies that do not have official ISO currency codes, such as cryptocurrencies and the currencies of certain countries. See the [currency code schema](plaid.com/docs/api/accounts#currency-code-schema) for a full listing of supported `iso_currency_code`s.
45 46 47 |
# File 'lib/the_plaid_api/models/pay_stub_earnings_breakdown.rb', line 45 def unofficial_currency_code @unofficial_currency_code end |
#ytd_amount ⇒ Float
The year-to-date amount of the deduction.
49 50 51 |
# File 'lib/the_plaid_api/models/pay_stub_earnings_breakdown.rb', line 49 def ytd_amount @ytd_amount end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 |
# File 'lib/the_plaid_api/models/pay_stub_earnings_breakdown.rb', line 102 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. canonical_description = hash.key?('canonical_description') ? hash['canonical_description'] : nil current_amount = hash.key?('current_amount') ? hash['current_amount'] : nil description = hash.key?('description') ? hash['description'] : nil hours = hash.key?('hours') ? hash['hours'] : nil iso_currency_code = hash.key?('iso_currency_code') ? hash['iso_currency_code'] : nil rate = hash.key?('rate') ? hash['rate'] : nil unofficial_currency_code = hash.key?('unofficial_currency_code') ? hash['unofficial_currency_code'] : nil ytd_amount = hash.key?('ytd_amount') ? hash['ytd_amount'] : 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. PayStubEarningsBreakdown.new(canonical_description: canonical_description, current_amount: current_amount, description: description, hours: hours, iso_currency_code: iso_currency_code, rate: rate, unofficial_currency_code: unofficial_currency_code, ytd_amount: ytd_amount, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/the_plaid_api/models/pay_stub_earnings_breakdown.rb', line 52 def self.names @_hash = {} if @_hash.nil? @_hash['canonical_description'] = 'canonical_description' @_hash['current_amount'] = 'current_amount' @_hash['description'] = 'description' @_hash['hours'] = 'hours' @_hash['iso_currency_code'] = 'iso_currency_code' @_hash['rate'] = 'rate' @_hash['unofficial_currency_code'] = 'unofficial_currency_code' @_hash['ytd_amount'] = 'ytd_amount' @_hash end |
.nullables ⇒ Object
An array for nullable fields
71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/the_plaid_api/models/pay_stub_earnings_breakdown.rb', line 71 def self.nullables %w[ canonical_description current_amount description hours iso_currency_code rate unofficial_currency_code ytd_amount ] end |
.optionals ⇒ Object
An array for optional fields
66 67 68 |
# File 'lib/the_plaid_api/models/pay_stub_earnings_breakdown.rb', line 66 def self.optionals [] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
149 150 151 152 153 154 155 156 |
# File 'lib/the_plaid_api/models/pay_stub_earnings_breakdown.rb', line 149 def inspect class_name = self.class.name.split('::').last "<#{class_name} canonical_description: #{@canonical_description.inspect}, current_amount:"\ " #{@current_amount.inspect}, description: #{@description.inspect}, hours:"\ " #{@hours.inspect}, iso_currency_code: #{@iso_currency_code.inspect}, rate:"\ " #{@rate.inspect}, unofficial_currency_code: #{@unofficial_currency_code.inspect},"\ " ytd_amount: #{@ytd_amount.inspect}, additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
139 140 141 142 143 144 145 146 |
# File 'lib/the_plaid_api/models/pay_stub_earnings_breakdown.rb', line 139 def to_s class_name = self.class.name.split('::').last "<#{class_name} canonical_description: #{@canonical_description}, current_amount:"\ " #{@current_amount}, description: #{@description}, hours: #{@hours}, iso_currency_code:"\ " #{@iso_currency_code}, rate: #{@rate}, unofficial_currency_code:"\ " #{@unofficial_currency_code}, ytd_amount: #{@ytd_amount}, additional_properties:"\ " #{@additional_properties}>" end |