Class: FdxV660Api::K1InterestIncome1

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

Overview

Schedule K-1 Supplemental Interest Income Information

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(us_treasury_interest: SKIP, us_treasury_dividend: SKIP, tax_exempt_state_interest: SKIP, private_activity_bond_interest: SKIP, additional_properties: nil) ⇒ K1InterestIncome1

Returns a new instance of K1InterestIncome1.



54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/fdx_v660_api/models/k1_interest_income1.rb', line 54

def initialize(us_treasury_interest: SKIP, us_treasury_dividend: SKIP,
               tax_exempt_state_interest: SKIP,
               private_activity_bond_interest: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @us_treasury_interest = us_treasury_interest unless us_treasury_interest == SKIP
  @us_treasury_dividend = us_treasury_dividend unless us_treasury_dividend == SKIP
  unless tax_exempt_state_interest == SKIP
    @tax_exempt_state_interest =
      tax_exempt_state_interest
  end
  unless private_activity_bond_interest == SKIP
    @private_activity_bond_interest =
      private_activity_bond_interest
  end
  @additional_properties = additional_properties
end

Instance Attribute Details

#private_activity_bond_interestFloat

Private activity bond interest

Returns:

  • (Float)


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

def private_activity_bond_interest
  @private_activity_bond_interest
end

#tax_exempt_state_interestFloat

Portion of municipal bond interest income which is tax exempt from taxpayer's State

Returns:

  • (Float)


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

def tax_exempt_state_interest
  @tax_exempt_state_interest
end

#us_treasury_dividendFloat

Portion of dividend income from US Treasury obligations

Returns:

  • (Float)


18
19
20
# File 'lib/fdx_v660_api/models/k1_interest_income1.rb', line 18

def us_treasury_dividend
  @us_treasury_dividend
end

#us_treasury_interestFloat

Portion of interest income from US Treasury obligations

Returns:

  • (Float)


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

def us_treasury_interest
  @us_treasury_interest
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# File 'lib/fdx_v660_api/models/k1_interest_income1.rb', line 75

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  us_treasury_interest =
    hash.key?('usTreasuryInterest') ? hash['usTreasuryInterest'] : SKIP
  us_treasury_dividend =
    hash.key?('usTreasuryDividend') ? hash['usTreasuryDividend'] : SKIP
  tax_exempt_state_interest =
    hash.key?('taxExemptStateInterest') ? hash['taxExemptStateInterest'] : SKIP
  private_activity_bond_interest =
    hash.key?('privateActivityBondInterest') ? hash['privateActivityBondInterest'] : 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.
  K1InterestIncome1.new(us_treasury_interest: us_treasury_interest,
                        us_treasury_dividend: us_treasury_dividend,
                        tax_exempt_state_interest: tax_exempt_state_interest,
                        private_activity_bond_interest: private_activity_bond_interest,
                        additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



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

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['us_treasury_interest'] = 'usTreasuryInterest'
  @_hash['us_treasury_dividend'] = 'usTreasuryDividend'
  @_hash['tax_exempt_state_interest'] = 'taxExemptStateInterest'
  @_hash['private_activity_bond_interest'] = 'privateActivityBondInterest'
  @_hash
end

.nullablesObject

An array for nullable fields



50
51
52
# File 'lib/fdx_v660_api/models/k1_interest_income1.rb', line 50

def self.nullables
  []
end

.optionalsObject

An array for optional fields



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

def self.optionals
  %w[
    us_treasury_interest
    us_treasury_dividend
    tax_exempt_state_interest
    private_activity_bond_interest
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



113
114
115
116
117
118
119
120
# File 'lib/fdx_v660_api/models/k1_interest_income1.rb', line 113

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} us_treasury_interest: #{@us_treasury_interest.inspect},"\
  " us_treasury_dividend: #{@us_treasury_dividend.inspect}, tax_exempt_state_interest:"\
  " #{@tax_exempt_state_interest.inspect}, private_activity_bond_interest:"\
  " #{@private_activity_bond_interest.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



104
105
106
107
108
109
110
# File 'lib/fdx_v660_api/models/k1_interest_income1.rb', line 104

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} us_treasury_interest: #{@us_treasury_interest}, us_treasury_dividend:"\
  " #{@us_treasury_dividend}, tax_exempt_state_interest: #{@tax_exempt_state_interest},"\
  " private_activity_bond_interest: #{@private_activity_bond_interest}, additional_properties:"\
  " #{@additional_properties}>"
end