Class: Taxamo::Report

Inherits:
Object show all
Defined in:
lib/taxamo/models/report.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Report

Returns a new instance of Report.



33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/taxamo/models/report.rb', line 33

def initialize(attributes = {})
  return if attributes.nil? or attributes.empty?
  # Morph attribute keys into undescored rubyish style
  if attributes.key?("currency_code")
    @currency_code = attributes["currency_code"]
      
  end
  if attributes.key?("skip_moss")
    @skip_moss = attributes["skip_moss"]
      
  end
  if attributes.key?("country_code")
    @country_code = attributes["country_code"]
      
  end
  if attributes.key?("tax_region")
    @tax_region = attributes["tax_region"]
      
  end
  if attributes.key?("country_subdivision")
    @country_subdivision = attributes["country_subdivision"]
      
  end
  if attributes.key?("amount")
    @amount = attributes["amount"]
      
  end
  if attributes.key?("tax_amount")
    @tax_amount = attributes["tax_amount"]
      
  end
  if attributes.key?("tax_rate")
    @tax_rate = attributes["tax_rate"]
      
  end
  if attributes.key?("country_name")
    @country_name = attributes["country_name"]
      
  end
  

end

Instance Attribute Details

#amountObject

Returns the value of attribute amount.



15
16
17
# File 'lib/taxamo/models/report.rb', line 15

def amount
  @amount
end

#country_codeObject

Returns the value of attribute country_code.



15
16
17
# File 'lib/taxamo/models/report.rb', line 15

def country_code
  @country_code
end

#country_nameObject

Returns the value of attribute country_name.



15
16
17
# File 'lib/taxamo/models/report.rb', line 15

def country_name
  @country_name
end

#country_subdivisionObject

Returns the value of attribute country_subdivision.



15
16
17
# File 'lib/taxamo/models/report.rb', line 15

def country_subdivision
  @country_subdivision
end

#currency_codeObject

Returns the value of attribute currency_code.



15
16
17
# File 'lib/taxamo/models/report.rb', line 15

def currency_code
  @currency_code
end

#skip_mossObject

Returns the value of attribute skip_moss.



15
16
17
# File 'lib/taxamo/models/report.rb', line 15

def skip_moss
  @skip_moss
end

#tax_amountObject

Returns the value of attribute tax_amount.



15
16
17
# File 'lib/taxamo/models/report.rb', line 15

def tax_amount
  @tax_amount
end

#tax_rateObject

Returns the value of attribute tax_rate.



15
16
17
# File 'lib/taxamo/models/report.rb', line 15

def tax_rate
  @tax_rate
end

#tax_regionObject

Returns the value of attribute tax_region.



15
16
17
# File 'lib/taxamo/models/report.rb', line 15

def tax_region
  @tax_region
end

Class Method Details

.attribute_mapObject

:internal => :external



18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/taxamo/models/report.rb', line 18

def self.attribute_map
  {
    :currency_code => :currency_code,
    :skip_moss => :skip_moss,
    :country_code => :country_code,
    :tax_region => :tax_region,
    :country_subdivision => :country_subdivision,
    :amount => :amount,
    :tax_amount => :tax_amount,
    :tax_rate => :tax_rate,
    :country_name => :country_name

  }
end

Instance Method Details

#to_bodyObject



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/taxamo/models/report.rb', line 76

def to_body
  body = {}
  self.class.attribute_map.each_pair do |key, value|
    v = self.send(key)
    unless v.nil?
      if v.is_a?(Array)
        array = Array.new
        v.each do |item|
          if item.respond_to?("to_body".to_sym)
            array.push item.to_body
          else
            array.push item
          end
        end
        body[value] = array
      else
        if v.respond_to?("to_body".to_sym)
          body[value] = v.to_body
        else
          body[value] = v
        end
      end
    end
  end
  body
end