Class: Taxamo::CalculateTaxLocationOut
- Defined in:
- lib/taxamo/models/calculatetaxlocationout.rb
Instance Attribute Summary collapse
-
#billing_country_code ⇒ Object
Returns the value of attribute billing_country_code.
-
#buyer_credit_card_prefix ⇒ Object
Returns the value of attribute buyer_credit_card_prefix.
-
#buyer_ip ⇒ Object
Returns the value of attribute buyer_ip.
-
#countries ⇒ Object
Returns the value of attribute countries.
-
#evidence ⇒ Object
Returns the value of attribute evidence.
-
#tax_country_code ⇒ Object
Returns the value of attribute tax_country_code.
-
#tax_deducted ⇒ Object
Returns the value of attribute tax_deducted.
-
#tax_supported ⇒ Object
Returns the value of attribute tax_supported.
Class Method Summary collapse
-
.attribute_map ⇒ Object
:internal => :external.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ CalculateTaxLocationOut
constructor
A new instance of CalculateTaxLocationOut.
- #to_body ⇒ Object
Constructor Details
#initialize(attributes = {}) ⇒ CalculateTaxLocationOut
32 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 |
# File 'lib/taxamo/models/calculatetaxlocationout.rb', line 32 def initialize(attributes = {}) return if attributes.nil? or attributes.empty? # Morph attribute keys into undescored rubyish style if attributes.key?("tax_country_code") @tax_country_code = attributes["tax_country_code"] end if attributes.key?("tax_deducted") @tax_deducted = attributes["tax_deducted"] end if attributes.key?("tax_supported") @tax_supported = attributes["tax_supported"] end if attributes.key?("countries") @countries = Countries.new(attributes["countries"]) end if attributes.key?("buyer_ip") @buyer_ip = attributes["buyer_ip"] end if attributes.key?("billing_country_code") @billing_country_code = attributes["billing_country_code"] end if attributes.key?("buyer_credit_card_prefix") @buyer_credit_card_prefix = attributes["buyer_credit_card_prefix"] end if attributes.key?("evidence") @evidence = Evidence.new(attributes["evidence"]) end end |
Instance Attribute Details
#billing_country_code ⇒ Object
Returns the value of attribute billing_country_code.
15 16 17 |
# File 'lib/taxamo/models/calculatetaxlocationout.rb', line 15 def billing_country_code @billing_country_code end |
#buyer_credit_card_prefix ⇒ Object
Returns the value of attribute buyer_credit_card_prefix.
15 16 17 |
# File 'lib/taxamo/models/calculatetaxlocationout.rb', line 15 def buyer_credit_card_prefix @buyer_credit_card_prefix end |
#buyer_ip ⇒ Object
Returns the value of attribute buyer_ip.
15 16 17 |
# File 'lib/taxamo/models/calculatetaxlocationout.rb', line 15 def buyer_ip @buyer_ip end |
#countries ⇒ Object
Returns the value of attribute countries.
15 16 17 |
# File 'lib/taxamo/models/calculatetaxlocationout.rb', line 15 def countries @countries end |
#evidence ⇒ Object
Returns the value of attribute evidence.
15 16 17 |
# File 'lib/taxamo/models/calculatetaxlocationout.rb', line 15 def evidence @evidence end |
#tax_country_code ⇒ Object
Returns the value of attribute tax_country_code.
15 16 17 |
# File 'lib/taxamo/models/calculatetaxlocationout.rb', line 15 def tax_country_code @tax_country_code end |
#tax_deducted ⇒ Object
Returns the value of attribute tax_deducted.
15 16 17 |
# File 'lib/taxamo/models/calculatetaxlocationout.rb', line 15 def tax_deducted @tax_deducted end |
#tax_supported ⇒ Object
Returns the value of attribute tax_supported.
15 16 17 |
# File 'lib/taxamo/models/calculatetaxlocationout.rb', line 15 def tax_supported @tax_supported end |
Class Method Details
.attribute_map ⇒ Object
:internal => :external
18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/taxamo/models/calculatetaxlocationout.rb', line 18 def self.attribute_map { :tax_country_code => :tax_country_code, :tax_deducted => :tax_deducted, :tax_supported => :tax_supported, :countries => :countries, :buyer_ip => :buyer_ip, :billing_country_code => :billing_country_code, :buyer_credit_card_prefix => :buyer_credit_card_prefix, :evidence => :evidence } end |
Instance Method Details
#to_body ⇒ Object
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 |
# File 'lib/taxamo/models/calculatetaxlocationout.rb', line 71 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 |