Class: Taxamo::ByTaxationType
- Defined in:
- lib/taxamo/models/bytaxationtype.rb
Instance Attribute Summary collapse
-
#deducted_count ⇒ Object
Returns the value of attribute deducted_count.
-
#eu_b2b ⇒ Object
Returns the value of attribute eu_b2b.
-
#eu_taxed ⇒ Object
Returns the value of attribute eu_taxed.
-
#taxed_count ⇒ Object
Returns the value of attribute taxed_count.
-
#transactions_count ⇒ Object
Returns the value of attribute transactions_count.
Class Method Summary collapse
-
.attribute_map ⇒ Object
:internal => :external.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ ByTaxationType
constructor
A new instance of ByTaxationType.
- #to_body ⇒ Object
Constructor Details
#initialize(attributes = {}) ⇒ ByTaxationType
Returns a new instance of ByTaxationType.
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/taxamo/models/bytaxationtype.rb', line 29 def initialize(attributes = {}) return if attributes.nil? or attributes.empty? # Morph attribute keys into undescored rubyish style if attributes.key?("taxed_count") @taxed_count = attributes["taxed_count"] end if attributes.key?("deducted_count") @deducted_count = attributes["deducted_count"] end if attributes.key?("transactions_count") @transactions_count = attributes["transactions_count"] end if attributes.key?("eu_b2b") @eu_b2b = attributes["eu_b2b"] end if attributes.key?("eu_taxed") @eu_taxed = attributes["eu_taxed"] end end |
Instance Attribute Details
#deducted_count ⇒ Object
Returns the value of attribute deducted_count.
15 16 17 |
# File 'lib/taxamo/models/bytaxationtype.rb', line 15 def deducted_count @deducted_count end |
#eu_b2b ⇒ Object
Returns the value of attribute eu_b2b.
15 16 17 |
# File 'lib/taxamo/models/bytaxationtype.rb', line 15 def eu_b2b @eu_b2b end |
#eu_taxed ⇒ Object
Returns the value of attribute eu_taxed.
15 16 17 |
# File 'lib/taxamo/models/bytaxationtype.rb', line 15 def eu_taxed @eu_taxed end |
#taxed_count ⇒ Object
Returns the value of attribute taxed_count.
15 16 17 |
# File 'lib/taxamo/models/bytaxationtype.rb', line 15 def taxed_count @taxed_count end |
#transactions_count ⇒ Object
Returns the value of attribute transactions_count.
15 16 17 |
# File 'lib/taxamo/models/bytaxationtype.rb', line 15 def transactions_count @transactions_count end |
Class Method Details
.attribute_map ⇒ Object
:internal => :external
18 19 20 21 22 23 24 25 26 27 |
# File 'lib/taxamo/models/bytaxationtype.rb', line 18 def self.attribute_map { :taxed_count => :taxed_count, :deducted_count => :deducted_count, :transactions_count => :transactions_count, :eu_b2b => :eu_b2b, :eu_taxed => :eu_taxed } end |
Instance Method Details
#to_body ⇒ Object
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 |
# File 'lib/taxamo/models/bytaxationtype.rb', line 56 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 |