Class: FdxV660Api::K1AlternativeMinimumTax

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

Overview

Form 1065 and 1120-S Schedule K-1 supplemental alternative minimum tax 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(leased_property_depreciation: SKIP, real_property_depreciation: SKIP, oil_and_gas: SKIP, geothermal: SKIP, additional_properties: nil) ⇒ K1AlternativeMinimumTax

Returns a new instance of K1AlternativeMinimumTax.



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

def initialize(leased_property_depreciation: SKIP,
               real_property_depreciation: SKIP, oil_and_gas: SKIP,
               geothermal: SKIP, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  unless leased_property_depreciation == SKIP
    @leased_property_depreciation =
      leased_property_depreciation
  end
  unless real_property_depreciation == SKIP
    @real_property_depreciation =
      real_property_depreciation
  end
  @oil_and_gas = oil_and_gas unless oil_and_gas == SKIP
  @geothermal = geothermal unless geothermal == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#geothermalK1AlternativeMinimumTaxDrilling1

Geothermal amounts included in 1065 K-1 box 17 or 1120-S K-1 box 15



29
30
31
# File 'lib/fdx_v660_api/models/k1_alternative_minimum_tax.rb', line 29

def geothermal
  @geothermal
end

#leased_property_depreciationFloat

Leased personal property - accelerated depreciation pre-1987 amounts included in 1065 K-1 box 17 or 1120-S K-1 box 15

Returns:

  • (Float)


16
17
18
# File 'lib/fdx_v660_api/models/k1_alternative_minimum_tax.rb', line 16

def leased_property_depreciation
  @leased_property_depreciation
end

#oil_and_gasK1AlternativeMinimumTaxDrilling3

Oil and gas amounts included in 1065 K-1 box 17 or 1120-S K-1 box 15



25
26
27
# File 'lib/fdx_v660_api/models/k1_alternative_minimum_tax.rb', line 25

def oil_and_gas
  @oil_and_gas
end

#real_property_depreciationFloat

Real property - accelerated depreciation pre-1987 amounts included in 1065 K-1 box 17 or 1120-S K-1 box 15

Returns:

  • (Float)


21
22
23
# File 'lib/fdx_v660_api/models/k1_alternative_minimum_tax.rb', line 21

def real_property_depreciation
  @real_property_depreciation
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
102
# File 'lib/fdx_v660_api/models/k1_alternative_minimum_tax.rb', line 76

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  leased_property_depreciation =
    hash.key?('leasedPropertyDepreciation') ? hash['leasedPropertyDepreciation'] : SKIP
  real_property_depreciation =
    hash.key?('realPropertyDepreciation') ? hash['realPropertyDepreciation'] : SKIP
  oil_and_gas = K1AlternativeMinimumTaxDrilling3.from_hash(hash['oilAndGas']) if
    hash['oilAndGas']
  geothermal = K1AlternativeMinimumTaxDrilling1.from_hash(hash['geothermal']) if
    hash['geothermal']

  # 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.
  K1AlternativeMinimumTax.new(leased_property_depreciation: leased_property_depreciation,
                              real_property_depreciation: real_property_depreciation,
                              oil_and_gas: oil_and_gas,
                              geothermal: geothermal,
                              additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



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

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['leased_property_depreciation'] = 'leasedPropertyDepreciation'
  @_hash['real_property_depreciation'] = 'realPropertyDepreciation'
  @_hash['oil_and_gas'] = 'oilAndGas'
  @_hash['geothermal'] = 'geothermal'
  @_hash
end

.nullablesObject

An array for nullable fields



52
53
54
# File 'lib/fdx_v660_api/models/k1_alternative_minimum_tax.rb', line 52

def self.nullables
  []
end

.optionalsObject

An array for optional fields



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

def self.optionals
  %w[
    leased_property_depreciation
    real_property_depreciation
    oil_and_gas
    geothermal
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



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

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} leased_property_depreciation: #{@leased_property_depreciation.inspect},"\
  " real_property_depreciation: #{@real_property_depreciation.inspect}, oil_and_gas:"\
  " #{@oil_and_gas.inspect}, geothermal: #{@geothermal.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



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

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} leased_property_depreciation: #{@leased_property_depreciation},"\
  " real_property_depreciation: #{@real_property_depreciation}, oil_and_gas: #{@oil_and_gas},"\
  " geothermal: #{@geothermal}, additional_properties: #{@additional_properties}>"
end