Class: FdxV660Api::K1OtherDeductions

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/fdx_v660_api/models/k1_other_deductions.rb

Overview

Supplemental Other Deduction Information for Form 1065 Schedule K-1 box 13 or Form 1120-S Schedule K-1 box 12

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(taxes: SKIP, miscellaneous: SKIP, retirement_plan_payments: SKIP, plan_type: SKIP, additional_properties: nil) ⇒ K1OtherDeductions

Returns a new instance of K1OtherDeductions.



55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/fdx_v660_api/models/k1_other_deductions.rb', line 55

def initialize(taxes: SKIP, miscellaneous: SKIP,
               retirement_plan_payments: SKIP, plan_type: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @taxes = taxes unless taxes == SKIP
  @miscellaneous = miscellaneous unless miscellaneous == SKIP
  @retirement_plan_payments = retirement_plan_payments unless retirement_plan_payments == SKIP
  @plan_type = plan_type unless plan_type == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#miscellaneousFloat

Other miscellaneous deductions included in 1065 K-1 box 13 or 1120-S K-1 box 12

Returns:

  • (Float)


20
21
22
# File 'lib/fdx_v660_api/models/k1_other_deductions.rb', line 20

def miscellaneous
  @miscellaneous
end

#plan_typeRetirementPlanType2

Retirement plan type for 1065 K-1 box 13 or 1120-S K-1 box 12

Returns:



28
29
30
# File 'lib/fdx_v660_api/models/k1_other_deductions.rb', line 28

def plan_type
  @plan_type
end

#retirement_plan_paymentsFloat

Retirement plan payments included in 1065 K-1 box 13 or 1120-S K-1 box 12

Returns:

  • (Float)


24
25
26
# File 'lib/fdx_v660_api/models/k1_other_deductions.rb', line 24

def retirement_plan_payments
  @retirement_plan_payments
end

#taxesFloat

Other taxes included in 1065 K-1 box 13 or 1120-S K-1 box 12

Returns:

  • (Float)


15
16
17
# File 'lib/fdx_v660_api/models/k1_other_deductions.rb', line 15

def taxes
  @taxes
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# File 'lib/fdx_v660_api/models/k1_other_deductions.rb', line 69

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  taxes = hash.key?('taxes') ? hash['taxes'] : SKIP
  miscellaneous = hash.key?('miscellaneous') ? hash['miscellaneous'] : SKIP
  retirement_plan_payments =
    hash.key?('retirementPlanPayments') ? hash['retirementPlanPayments'] : SKIP
  plan_type = hash.key?('planType') ? hash['planType'] : 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.
  K1OtherDeductions.new(taxes: taxes,
                        miscellaneous: miscellaneous,
                        retirement_plan_payments: retirement_plan_payments,
                        plan_type: plan_type,
                        additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



31
32
33
34
35
36
37
38
# File 'lib/fdx_v660_api/models/k1_other_deductions.rb', line 31

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['taxes'] = 'taxes'
  @_hash['miscellaneous'] = 'miscellaneous'
  @_hash['retirement_plan_payments'] = 'retirementPlanPayments'
  @_hash['plan_type'] = 'planType'
  @_hash
end

.nullablesObject

An array for nullable fields



51
52
53
# File 'lib/fdx_v660_api/models/k1_other_deductions.rb', line 51

def self.nullables
  []
end

.optionalsObject

An array for optional fields



41
42
43
44
45
46
47
48
# File 'lib/fdx_v660_api/models/k1_other_deductions.rb', line 41

def self.optionals
  %w[
    taxes
    miscellaneous
    retirement_plan_payments
    plan_type
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



103
104
105
106
107
108
# File 'lib/fdx_v660_api/models/k1_other_deductions.rb', line 103

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} taxes: #{@taxes.inspect}, miscellaneous: #{@miscellaneous.inspect},"\
  " retirement_plan_payments: #{@retirement_plan_payments.inspect}, plan_type:"\
  " #{@plan_type.inspect}, additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



95
96
97
98
99
100
# File 'lib/fdx_v660_api/models/k1_other_deductions.rb', line 95

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} taxes: #{@taxes}, miscellaneous: #{@miscellaneous},"\
  " retirement_plan_payments: #{@retirement_plan_payments}, plan_type: #{@plan_type},"\
  " additional_properties: #{@additional_properties}>"
end