class Taxamo::Countries

Attributes

by_2003_rules[RW]
by_billing[RW]
by_cc[RW]
by_ip[RW]
by_tax_number[RW]
by_token[RW]
detected[RW]
forced[RW]
guessed_from_ip[RW]
other_commercially_relevant_info[RW]
self_declaration[RW]

Public Class Methods

attribute_map() click to toggle source

:internal => :external

# 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
new(attributes = {}) click to toggle source
# 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

Public Instance Methods

to_body() click to toggle source
# 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