Class: FdxV660Api::AnnualPaymentAmounts1
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- FdxV660Api::AnnualPaymentAmounts1
- Defined in:
- lib/fdx_v660_api/models/annual_payment_amounts1.rb
Overview
Year-to-date pay for current year and total annual pay for previous years
Instance Attribute Summary collapse
-
#gross_pay ⇒ PaymentAmounts2
Gross pay for covered period.
-
#net_pay ⇒ MonetaryAmount5
Net pay for covered period.
-
#year ⇒ Integer
The year in which this income was earned.
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(year:, gross_pay:, net_pay: SKIP, additional_properties: nil) ⇒ AnnualPaymentAmounts1
constructor
A new instance of AnnualPaymentAmounts1.
-
#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(year:, gross_pay:, net_pay: SKIP, additional_properties: nil) ⇒ AnnualPaymentAmounts1
Returns a new instance of AnnualPaymentAmounts1.
45 46 47 48 49 50 51 52 53 |
# File 'lib/fdx_v660_api/models/annual_payment_amounts1.rb', line 45 def initialize(year:, gross_pay:, net_pay: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @year = year @gross_pay = gross_pay @net_pay = net_pay unless net_pay == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#gross_pay ⇒ PaymentAmounts2
Gross pay for covered period
18 19 20 |
# File 'lib/fdx_v660_api/models/annual_payment_amounts1.rb', line 18 def gross_pay @gross_pay end |
#net_pay ⇒ MonetaryAmount5
Net pay for covered period
22 23 24 |
# File 'lib/fdx_v660_api/models/annual_payment_amounts1.rb', line 22 def net_pay @net_pay end |
#year ⇒ Integer
The year in which this income was earned
14 15 16 |
# File 'lib/fdx_v660_api/models/annual_payment_amounts1.rb', line 14 def year @year end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/fdx_v660_api/models/annual_payment_amounts1.rb', line 56 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. year = hash.key?('year') ? hash['year'] : nil gross_pay = PaymentAmounts2.from_hash(hash['grossPay']) if hash['grossPay'] net_pay = MonetaryAmount5.from_hash(hash['netPay']) if hash['netPay'] # 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. AnnualPaymentAmounts1.new(year: year, gross_pay: gross_pay, net_pay: net_pay, 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/fdx_v660_api/models/annual_payment_amounts1.rb', line 25 def self.names @_hash = {} if @_hash.nil? @_hash['year'] = 'year' @_hash['gross_pay'] = 'grossPay' @_hash['net_pay'] = 'netPay' @_hash end |
.nullables ⇒ Object
An array for nullable fields
41 42 43 |
# File 'lib/fdx_v660_api/models/annual_payment_amounts1.rb', line 41 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
34 35 36 37 38 |
# File 'lib/fdx_v660_api/models/annual_payment_amounts1.rb', line 34 def self.optionals %w[ net_pay ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
86 87 88 89 90 |
# File 'lib/fdx_v660_api/models/annual_payment_amounts1.rb', line 86 def inspect class_name = self.class.name.split('::').last "<#{class_name} year: #{@year.inspect}, gross_pay: #{@gross_pay.inspect}, net_pay:"\ " #{@net_pay.inspect}, additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
79 80 81 82 83 |
# File 'lib/fdx_v660_api/models/annual_payment_amounts1.rb', line 79 def to_s class_name = self.class.name.split('::').last "<#{class_name} year: #{@year}, gross_pay: #{@gross_pay}, net_pay: #{@net_pay},"\ " additional_properties: #{@additional_properties}>" end |