Class: Avalara::Response::Invoice
- Inherits:
-
Types::Stash
- Object
- Hashie::Trash
- Types::Stash
- Avalara::Response::Invoice
- Defined in:
- lib/avalara/response/invoice.rb
Instance Method Summary collapse
-
#initialize(response) ⇒ Invoice
constructor
A new instance of Invoice.
- #Messages=(new_messages) ⇒ Object
- #success? ⇒ Boolean
- #TaxAddresses=(addresses) ⇒ Object
- #TaxLines=(lines) ⇒ Object
Constructor Details
#initialize(response) ⇒ Invoice
Returns a new instance of Invoice.
24 25 26 |
# File 'lib/avalara/response/invoice.rb', line 24 def initialize(response) super(Hashie::Extensions::SymbolizeKeys.symbolize_keys(response)) end |
Instance Method Details
#Messages=(new_messages) ⇒ Object
32 33 34 35 36 37 |
# File 'lib/avalara/response/invoice.rb', line 32 def Messages=() self. = [] .each do || self. << Message.new() end end |
#success? ⇒ Boolean
28 29 30 |
# File 'lib/avalara/response/invoice.rb', line 28 def success? result_code == 'Success' end |
#TaxAddresses=(addresses) ⇒ Object
46 47 48 49 50 51 |
# File 'lib/avalara/response/invoice.rb', line 46 def TaxAddresses=(addresses) self.tax_addresses = [] addresses.each do |address| self.tax_addresses << TaxAddress.new(address) end end |
#TaxLines=(lines) ⇒ Object
39 40 41 42 43 44 |
# File 'lib/avalara/response/invoice.rb', line 39 def TaxLines=(lines) self.tax_lines = [] lines.each do |line| self.tax_lines << TaxLine.new(line) end end |