Class: XeroGateway::Response
- Inherits:
-
Object
- Object
- XeroGateway::Response
- Defined in:
- lib/xero_gateway/response.rb
Instance Attribute Summary collapse
-
#date_time ⇒ Object
Returns the value of attribute date_time.
-
#errors ⇒ Object
Returns the value of attribute errors.
-
#provider ⇒ Object
Returns the value of attribute provider.
-
#request_params ⇒ Object
Returns the value of attribute request_params.
-
#request_xml ⇒ Object
Returns the value of attribute request_xml.
-
#response_id ⇒ Object
Returns the value of attribute response_id.
-
#response_item ⇒ Object
(also: #invoice, #credit_note, #bank_transaction, #manual_journal, #contact, #organisation)
Returns the value of attribute response_item.
-
#response_xml ⇒ Object
Returns the value of attribute response_xml.
-
#status ⇒ Object
Returns the value of attribute status.
Instance Method Summary collapse
- #array_wrapped_response_item ⇒ Object (also: #invoices, #credit_notes, #bank_transactions, #manual_journals, #contacts, #accounts, #tracking_categories, #tax_rates, #currencies)
- #error ⇒ Object
-
#initialize(params = {}) ⇒ Response
constructor
A new instance of Response.
- #success? ⇒ Boolean
Constructor Details
#initialize(params = {}) ⇒ Response
Returns a new instance of Response.
25 26 27 28 29 30 31 32 |
# File 'lib/xero_gateway/response.rb', line 25 def initialize(params = {}) params.each do |k,v| self.send("#{k}=", v) end @errors ||= [] @response_item ||= [] end |
Instance Attribute Details
#date_time ⇒ Object
Returns the value of attribute date_time.
3 4 5 |
# File 'lib/xero_gateway/response.rb', line 3 def date_time @date_time end |
#errors ⇒ Object
Returns the value of attribute errors.
3 4 5 |
# File 'lib/xero_gateway/response.rb', line 3 def errors @errors end |
#provider ⇒ Object
Returns the value of attribute provider.
3 4 5 |
# File 'lib/xero_gateway/response.rb', line 3 def provider @provider end |
#request_params ⇒ Object
Returns the value of attribute request_params.
3 4 5 |
# File 'lib/xero_gateway/response.rb', line 3 def request_params @request_params end |
#request_xml ⇒ Object
Returns the value of attribute request_xml.
3 4 5 |
# File 'lib/xero_gateway/response.rb', line 3 def request_xml @request_xml end |
#response_id ⇒ Object
Returns the value of attribute response_id.
3 4 5 |
# File 'lib/xero_gateway/response.rb', line 3 def response_id @response_id end |
#response_item ⇒ Object Also known as: invoice, credit_note, bank_transaction, manual_journal, contact, organisation
Returns the value of attribute response_item.
3 4 5 |
# File 'lib/xero_gateway/response.rb', line 3 def response_item @response_item end |
#response_xml ⇒ Object
Returns the value of attribute response_xml.
3 4 5 |
# File 'lib/xero_gateway/response.rb', line 3 def response_xml @response_xml end |
#status ⇒ Object
Returns the value of attribute status.
3 4 5 |
# File 'lib/xero_gateway/response.rb', line 3 def status @status end |
Instance Method Details
#array_wrapped_response_item ⇒ Object Also known as: invoices, credit_notes, bank_transactions, manual_journals, contacts, accounts, tracking_categories, tax_rates, currencies
5 6 7 |
# File 'lib/xero_gateway/response.rb', line 5 def array_wrapped_response_item Array(response_item) end |
#error ⇒ Object
39 40 41 |
# File 'lib/xero_gateway/response.rb', line 39 def error errors.blank? ? nil : errors[0] end |
#success? ⇒ Boolean
35 36 37 |
# File 'lib/xero_gateway/response.rb', line 35 def success? status == "OK" end |