class Taxamo::InvoiceAddress
Attributes
address_detail[RW]
building_number[RW]
city[RW]
country[RW]
freeform_address[RW]
postal_code[RW]
region[RW]
street_name[RW]
Public Class Methods
attribute_map()
click to toggle source
:internal => :external
# File lib/taxamo/models/invoiceaddress.rb, line 18 def self.attribute_map { :freeform_address => :freeform_address, :building_number => :building_number, :street_name => :street_name, :address_detail => :address_detail, :city => :city, :postal_code => :postal_code, :region => :region, :country => :country } end
new(attributes = {})
click to toggle source
# File lib/taxamo/models/invoiceaddress.rb, line 32 def initialize(attributes = {}) return if attributes.nil? or attributes.empty? # Morph attribute keys into undescored rubyish style if attributes.key?("freeform_address") @freeform_address = attributes["freeform_address"] end if attributes.key?("building_number") @building_number = attributes["building_number"] end if attributes.key?("street_name") @street_name = attributes["street_name"] end if attributes.key?("address_detail") @address_detail = attributes["address_detail"] end if attributes.key?("city") @city = attributes["city"] end if attributes.key?("postal_code") @postal_code = attributes["postal_code"] end if attributes.key?("region") @region = attributes["region"] end if attributes.key?("country") @country = attributes["country"] end end
Public Instance Methods
to_body()
click to toggle source
# File lib/taxamo/models/invoiceaddress.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