Class: Taxamo::UsTaxExemptionCertificateDetailsSchema
- Defined in:
- lib/taxamo/models/ustaxexemptioncertificatedetailsschema.rb
Instance Attribute Summary collapse
-
#exempt_states ⇒ Object
Returns the value of attribute exempt_states.
-
#purchaser_address1 ⇒ Object
Returns the value of attribute purchaser_address1.
-
#purchaser_address2 ⇒ Object
Returns the value of attribute purchaser_address2.
-
#purchaser_business_type ⇒ Object
Returns the value of attribute purchaser_business_type.
-
#purchaser_business_type_other_value ⇒ Object
Returns the value of attribute purchaser_business_type_other_value.
-
#purchaser_city ⇒ Object
Returns the value of attribute purchaser_city.
-
#purchaser_exemption_reason ⇒ Object
Returns the value of attribute purchaser_exemption_reason.
-
#purchaser_exemption_reason_value ⇒ Object
Returns the value of attribute purchaser_exemption_reason_value.
-
#purchaser_first_name ⇒ Object
Returns the value of attribute purchaser_first_name.
-
#purchaser_last_name ⇒ Object
Returns the value of attribute purchaser_last_name.
-
#purchaser_state ⇒ Object
Returns the value of attribute purchaser_state.
-
#purchaser_tax_id ⇒ Object
Returns the value of attribute purchaser_tax_id.
-
#purchaser_title ⇒ Object
Returns the value of attribute purchaser_title.
-
#purchaser_zip ⇒ Object
Returns the value of attribute purchaser_zip.
-
#single_purchase ⇒ Object
Returns the value of attribute single_purchase.
-
#single_purchase_order_identifier ⇒ Object
Returns the value of attribute single_purchase_order_identifier.
Class Method Summary collapse
-
.attribute_map ⇒ Object
:internal => :external.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ UsTaxExemptionCertificateDetailsSchema
constructor
A new instance of UsTaxExemptionCertificateDetailsSchema.
- #to_body ⇒ Object
Constructor Details
#initialize(attributes = {}) ⇒ UsTaxExemptionCertificateDetailsSchema
Returns a new instance of UsTaxExemptionCertificateDetailsSchema.
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 85 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 |
# File 'lib/taxamo/models/ustaxexemptioncertificatedetailsschema.rb', line 40 def initialize(attributes = {}) return if attributes.nil? or attributes.empty? # Morph attribute keys into undescored rubyish style if attributes.key?("single_purchase_order_identifier") @single_purchase_order_identifier = attributes["single_purchase_order_identifier"] end if attributes.key?("purchaser_business_type") @purchaser_business_type = attributes["purchaser_business_type"] end if attributes.key?("purchaser_exemption_reason_value") @purchaser_exemption_reason_value = attributes["purchaser_exemption_reason_value"] end if attributes.key?("purchaser_state") @purchaser_state = attributes["purchaser_state"] end if attributes.key?("purchaser_zip") @purchaser_zip = attributes["purchaser_zip"] end if attributes.key?("purchaser_city") @purchaser_city = attributes["purchaser_city"] end if attributes.key?("purchaser_last_name") @purchaser_last_name = attributes["purchaser_last_name"] end if attributes.key?("purchaser_exemption_reason") @purchaser_exemption_reason = attributes["purchaser_exemption_reason"] end if attributes.key?("single_purchase") @single_purchase = attributes["single_purchase"] end if attributes.key?("purchaser_tax_id") @purchaser_tax_id = UsTaxId.new(attributes["purchaser_tax_id"]) end if attributes.key?("purchaser_address2") @purchaser_address2 = attributes["purchaser_address2"] end if attributes.key?("purchaser_address1") @purchaser_address1 = attributes["purchaser_address1"] end if attributes.key?("purchaser_business_type_other_value") @purchaser_business_type_other_value = attributes["purchaser_business_type_other_value"] end if attributes.key?("purchaser_first_name") @purchaser_first_name = attributes["purchaser_first_name"] end if attributes.key?("exempt_states") if (value = attributes["exempt_states"]).is_a?(Array) @exempt_states = value.map{ |v| UsTaxExemptState.new(v) } end end if attributes.key?("purchaser_title") @purchaser_title = attributes["purchaser_title"] end end |
Instance Attribute Details
#exempt_states ⇒ Object
Returns the value of attribute exempt_states.
15 16 17 |
# File 'lib/taxamo/models/ustaxexemptioncertificatedetailsschema.rb', line 15 def exempt_states @exempt_states end |
#purchaser_address1 ⇒ Object
Returns the value of attribute purchaser_address1.
15 16 17 |
# File 'lib/taxamo/models/ustaxexemptioncertificatedetailsschema.rb', line 15 def purchaser_address1 @purchaser_address1 end |
#purchaser_address2 ⇒ Object
Returns the value of attribute purchaser_address2.
15 16 17 |
# File 'lib/taxamo/models/ustaxexemptioncertificatedetailsschema.rb', line 15 def purchaser_address2 @purchaser_address2 end |
#purchaser_business_type ⇒ Object
Returns the value of attribute purchaser_business_type.
15 16 17 |
# File 'lib/taxamo/models/ustaxexemptioncertificatedetailsschema.rb', line 15 def purchaser_business_type @purchaser_business_type end |
#purchaser_business_type_other_value ⇒ Object
Returns the value of attribute purchaser_business_type_other_value.
15 16 17 |
# File 'lib/taxamo/models/ustaxexemptioncertificatedetailsschema.rb', line 15 def purchaser_business_type_other_value @purchaser_business_type_other_value end |
#purchaser_city ⇒ Object
Returns the value of attribute purchaser_city.
15 16 17 |
# File 'lib/taxamo/models/ustaxexemptioncertificatedetailsschema.rb', line 15 def purchaser_city @purchaser_city end |
#purchaser_exemption_reason ⇒ Object
Returns the value of attribute purchaser_exemption_reason.
15 16 17 |
# File 'lib/taxamo/models/ustaxexemptioncertificatedetailsschema.rb', line 15 def purchaser_exemption_reason @purchaser_exemption_reason end |
#purchaser_exemption_reason_value ⇒ Object
Returns the value of attribute purchaser_exemption_reason_value.
15 16 17 |
# File 'lib/taxamo/models/ustaxexemptioncertificatedetailsschema.rb', line 15 def purchaser_exemption_reason_value @purchaser_exemption_reason_value end |
#purchaser_first_name ⇒ Object
Returns the value of attribute purchaser_first_name.
15 16 17 |
# File 'lib/taxamo/models/ustaxexemptioncertificatedetailsschema.rb', line 15 def purchaser_first_name @purchaser_first_name end |
#purchaser_last_name ⇒ Object
Returns the value of attribute purchaser_last_name.
15 16 17 |
# File 'lib/taxamo/models/ustaxexemptioncertificatedetailsschema.rb', line 15 def purchaser_last_name @purchaser_last_name end |
#purchaser_state ⇒ Object
Returns the value of attribute purchaser_state.
15 16 17 |
# File 'lib/taxamo/models/ustaxexemptioncertificatedetailsschema.rb', line 15 def purchaser_state @purchaser_state end |
#purchaser_tax_id ⇒ Object
Returns the value of attribute purchaser_tax_id.
15 16 17 |
# File 'lib/taxamo/models/ustaxexemptioncertificatedetailsschema.rb', line 15 def purchaser_tax_id @purchaser_tax_id end |
#purchaser_title ⇒ Object
Returns the value of attribute purchaser_title.
15 16 17 |
# File 'lib/taxamo/models/ustaxexemptioncertificatedetailsschema.rb', line 15 def purchaser_title @purchaser_title end |
#purchaser_zip ⇒ Object
Returns the value of attribute purchaser_zip.
15 16 17 |
# File 'lib/taxamo/models/ustaxexemptioncertificatedetailsschema.rb', line 15 def purchaser_zip @purchaser_zip end |
#single_purchase ⇒ Object
Returns the value of attribute single_purchase.
15 16 17 |
# File 'lib/taxamo/models/ustaxexemptioncertificatedetailsschema.rb', line 15 def single_purchase @single_purchase end |
#single_purchase_order_identifier ⇒ Object
Returns the value of attribute single_purchase_order_identifier.
15 16 17 |
# File 'lib/taxamo/models/ustaxexemptioncertificatedetailsschema.rb', line 15 def single_purchase_order_identifier @single_purchase_order_identifier 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 34 35 36 37 38 |
# File 'lib/taxamo/models/ustaxexemptioncertificatedetailsschema.rb', line 18 def self.attribute_map { :single_purchase_order_identifier => :single_purchase_order_identifier, :purchaser_business_type => :purchaser_business_type, :purchaser_exemption_reason_value => :purchaser_exemption_reason_value, :purchaser_state => :purchaser_state, :purchaser_zip => :purchaser_zip, :purchaser_city => :purchaser_city, :purchaser_last_name => :purchaser_last_name, :purchaser_exemption_reason => :purchaser_exemption_reason, :single_purchase => :single_purchase, :purchaser_tax_id => :purchaser_tax_id, :purchaser_address2 => :purchaser_address2, :purchaser_address1 => :purchaser_address1, :purchaser_business_type_other_value => :purchaser_business_type_other_value, :purchaser_first_name => :purchaser_first_name, :exempt_states => :exempt_states, :purchaser_title => :purchaser_title } end |
Instance Method Details
#to_body ⇒ Object
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 |
# File 'lib/taxamo/models/ustaxexemptioncertificatedetailsschema.rb', line 112 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 |