Class: FdxV660Api::K1Supplemental2

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

Overview

Supplemental Information for Form 1120-S Schedule K-1 (S Corporation)

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(foreign_partnership: SKIP, farm_activity: SKIP, other_income: SKIP, other_deductions: SKIP, alternative_minimum_tax: SKIP, interest_income: SKIP, additional_properties: nil) ⇒ K1Supplemental2

Returns a new instance of K1Supplemental2.



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/fdx_v660_api/models/k1_supplemental2.rb', line 66

def initialize(foreign_partnership: SKIP, farm_activity: SKIP,
               other_income: SKIP, other_deductions: SKIP,
               alternative_minimum_tax: SKIP, interest_income: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @foreign_partnership = foreign_partnership unless foreign_partnership == SKIP
  @farm_activity = farm_activity unless farm_activity == SKIP
  @other_income = other_income unless other_income == SKIP
  @other_deductions = other_deductions unless other_deductions == SKIP
  @alternative_minimum_tax = alternative_minimum_tax unless alternative_minimum_tax == SKIP
  @interest_income = interest_income unless interest_income == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#alternative_minimum_taxK1AlternativeMinimumTax1

Schedule K-1 Supplemental Alternative Minimum Tax Information



31
32
33
# File 'lib/fdx_v660_api/models/k1_supplemental2.rb', line 31

def alternative_minimum_tax
  @alternative_minimum_tax
end

#farm_activityTrueClass | FalseClass

Self-employment is from a farm activity, for Form 1065 Schedule K-1 Box 14 with code A

Returns:

  • (TrueClass | FalseClass)


19
20
21
# File 'lib/fdx_v660_api/models/k1_supplemental2.rb', line 19

def farm_activity
  @farm_activity
end

#foreign_partnershipTrueClass | FalseClass

Foreign partnership

Returns:

  • (TrueClass | FalseClass)


14
15
16
# File 'lib/fdx_v660_api/models/k1_supplemental2.rb', line 14

def foreign_partnership
  @foreign_partnership
end

#interest_incomeK1InterestIncome1

Schedule K-1 Supplemental Interest Income Information

Returns:



35
36
37
# File 'lib/fdx_v660_api/models/k1_supplemental2.rb', line 35

def interest_income
  @interest_income
end

#other_deductionsK1OtherDeductions1

Schedule K-1 Supplemental Other Deduction Information

Returns:



27
28
29
# File 'lib/fdx_v660_api/models/k1_supplemental2.rb', line 27

def other_deductions
  @other_deductions
end

#other_incomeK1OtherIncome1

Schedule K-1 Supplemental Other Income Information

Returns:



23
24
25
# File 'lib/fdx_v660_api/models/k1_supplemental2.rb', line 23

def other_income
  @other_income
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# File 'lib/fdx_v660_api/models/k1_supplemental2.rb', line 83

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  foreign_partnership =
    hash.key?('foreignPartnership') ? hash['foreignPartnership'] : SKIP
  farm_activity = hash.key?('farmActivity') ? hash['farmActivity'] : SKIP
  other_income = K1OtherIncome1.from_hash(hash['otherIncome']) if hash['otherIncome']
  other_deductions = K1OtherDeductions1.from_hash(hash['otherDeductions']) if
    hash['otherDeductions']
  alternative_minimum_tax = K1AlternativeMinimumTax1.from_hash(hash['alternativeMinimumTax']) if
    hash['alternativeMinimumTax']
  interest_income = K1InterestIncome1.from_hash(hash['interestIncome']) if
    hash['interestIncome']

  # 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.
  K1Supplemental2.new(foreign_partnership: foreign_partnership,
                      farm_activity: farm_activity,
                      other_income: other_income,
                      other_deductions: other_deductions,
                      alternative_minimum_tax: alternative_minimum_tax,
                      interest_income: interest_income,
                      additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



38
39
40
41
42
43
44
45
46
47
# File 'lib/fdx_v660_api/models/k1_supplemental2.rb', line 38

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['foreign_partnership'] = 'foreignPartnership'
  @_hash['farm_activity'] = 'farmActivity'
  @_hash['other_income'] = 'otherIncome'
  @_hash['other_deductions'] = 'otherDeductions'
  @_hash['alternative_minimum_tax'] = 'alternativeMinimumTax'
  @_hash['interest_income'] = 'interestIncome'
  @_hash
end

.nullablesObject

An array for nullable fields



62
63
64
# File 'lib/fdx_v660_api/models/k1_supplemental2.rb', line 62

def self.nullables
  []
end

.optionalsObject

An array for optional fields



50
51
52
53
54
55
56
57
58
59
# File 'lib/fdx_v660_api/models/k1_supplemental2.rb', line 50

def self.optionals
  %w[
    foreign_partnership
    farm_activity
    other_income
    other_deductions
    alternative_minimum_tax
    interest_income
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



125
126
127
128
129
130
131
132
# File 'lib/fdx_v660_api/models/k1_supplemental2.rb', line 125

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} foreign_partnership: #{@foreign_partnership.inspect}, farm_activity:"\
  " #{@farm_activity.inspect}, other_income: #{@other_income.inspect}, other_deductions:"\
  " #{@other_deductions.inspect}, alternative_minimum_tax:"\
  " #{@alternative_minimum_tax.inspect}, interest_income: #{@interest_income.inspect},"\
  " additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



116
117
118
119
120
121
122
# File 'lib/fdx_v660_api/models/k1_supplemental2.rb', line 116

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} foreign_partnership: #{@foreign_partnership}, farm_activity:"\
  " #{@farm_activity}, other_income: #{@other_income}, other_deductions: #{@other_deductions},"\
  " alternative_minimum_tax: #{@alternative_minimum_tax}, interest_income:"\
  " #{@interest_income}, additional_properties: #{@additional_properties}>"
end