Class: Taxamo::Countries
Instance Attribute Summary collapse
-
#by_2003_rules ⇒ Object
Returns the value of attribute by_2003_rules.
-
#by_billing ⇒ Object
Returns the value of attribute by_billing.
-
#by_cc ⇒ Object
Returns the value of attribute by_cc.
-
#by_ip ⇒ Object
Returns the value of attribute by_ip.
-
#by_tax_number ⇒ Object
Returns the value of attribute by_tax_number.
-
#by_token ⇒ Object
Returns the value of attribute by_token.
-
#detected ⇒ Object
Returns the value of attribute detected.
-
#forced ⇒ Object
Returns the value of attribute forced.
-
#guessed_from_ip ⇒ Object
Returns the value of attribute guessed_from_ip.
-
#other_commercially_relevant_info ⇒ Object
Returns the value of attribute other_commercially_relevant_info.
-
#self_declaration ⇒ Object
Returns the value of attribute self_declaration.
Class Method Summary collapse
-
.attribute_map ⇒ Object
:internal => :external.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Countries
constructor
A new instance of Countries.
- #to_body ⇒ Object
Constructor Details
#initialize(attributes = {}) ⇒ Countries
Returns a new instance of Countries.
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 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/taxamo/models/countries.rb', line 35 def initialize(attributes = {}) return if attributes.nil? or attributes.empty? # Morph attribute keys into undescored rubyish style if attributes.key?("by_token") @by_token = CountrySchema.new(attributes["by_token"]) end if attributes.key?("by_cc") @by_cc = CountrySchema.new(attributes["by_cc"]) end if attributes.key?("by_2003_rules") @by_2003_rules = CountrySchema.new(attributes["by_2003_rules"]) end if attributes.key?("forced") @forced = CountrySchema.new(attributes["forced"]) end if attributes.key?("by_ip") @by_ip = CountrySchema.new(attributes["by_ip"]) end if attributes.key?("guessed_from_ip") @guessed_from_ip = CountrySchema.new(attributes["guessed_from_ip"]) end if attributes.key?("other_commercially_relevant_info") @other_commercially_relevant_info = CountrySchema.new(attributes["other_commercially_relevant_info"]) end if attributes.key?("by_billing") @by_billing = CountrySchema.new(attributes["by_billing"]) end if attributes.key?("by_tax_number") @by_tax_number = CountrySchema.new(attributes["by_tax_number"]) end if attributes.key?("detected") @detected = CountrySchema.new(attributes["detected"]) end if attributes.key?("self_declaration") @self_declaration = CountrySchema.new(attributes["self_declaration"]) end end |
Instance Attribute Details
#by_2003_rules ⇒ Object
Returns the value of attribute by_2003_rules.
15 16 17 |
# File 'lib/taxamo/models/countries.rb', line 15 def by_2003_rules @by_2003_rules end |
#by_billing ⇒ Object
Returns the value of attribute by_billing.
15 16 17 |
# File 'lib/taxamo/models/countries.rb', line 15 def by_billing @by_billing end |
#by_cc ⇒ Object
Returns the value of attribute by_cc.
15 16 17 |
# File 'lib/taxamo/models/countries.rb', line 15 def by_cc @by_cc end |
#by_ip ⇒ Object
Returns the value of attribute by_ip.
15 16 17 |
# File 'lib/taxamo/models/countries.rb', line 15 def by_ip @by_ip end |
#by_tax_number ⇒ Object
Returns the value of attribute by_tax_number.
15 16 17 |
# File 'lib/taxamo/models/countries.rb', line 15 def by_tax_number @by_tax_number end |
#by_token ⇒ Object
Returns the value of attribute by_token.
15 16 17 |
# File 'lib/taxamo/models/countries.rb', line 15 def by_token @by_token end |
#detected ⇒ Object
Returns the value of attribute detected.
15 16 17 |
# File 'lib/taxamo/models/countries.rb', line 15 def detected @detected end |
#forced ⇒ Object
Returns the value of attribute forced.
15 16 17 |
# File 'lib/taxamo/models/countries.rb', line 15 def forced @forced end |
#guessed_from_ip ⇒ Object
Returns the value of attribute guessed_from_ip.
15 16 17 |
# File 'lib/taxamo/models/countries.rb', line 15 def guessed_from_ip @guessed_from_ip end |
#other_commercially_relevant_info ⇒ Object
Returns the value of attribute other_commercially_relevant_info.
15 16 17 |
# File 'lib/taxamo/models/countries.rb', line 15 def other_commercially_relevant_info @other_commercially_relevant_info end |
#self_declaration ⇒ Object
Returns the value of attribute self_declaration.
15 16 17 |
# File 'lib/taxamo/models/countries.rb', line 15 def self_declaration @self_declaration end |
Class Method Details
.attribute_map ⇒ Object
:internal => :external
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/taxamo/models/countries.rb', line 18 def self.attribute_map { :by_token => :by_token, :by_cc => :by_cc, :by_2003_rules => :by_2003_rules, :forced => :forced, :by_ip => :by_ip, :guessed_from_ip => :guessed_from_ip, :other_commercially_relevant_info => :other_commercially_relevant_info, :by_billing => :by_billing, :by_tax_number => :by_tax_number, :detected => :detected, :self_declaration => :self_declaration } end |
Instance Method Details
#to_body ⇒ Object
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 |
# File 'lib/taxamo/models/countries.rb', line 86 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 |