Class: XeroKiwi::Accounting::Organisation
- Inherits:
-
Object
- Object
- XeroKiwi::Accounting::Organisation
- Includes:
- Resource
- Defined in:
- lib/xero_kiwi/accounting/organisation.rb
Overview
Represents a Xero Organisation (tenant) returned by the Accounting API.
See: developer.xero.com/documentation/api/accounting/organisation
Class Method Summary collapse
-
.from_response(payload) ⇒ Object
Xero’s /Organisation endpoint returns a one-element “Organisations” array — we unwrap it to a single object.
Instance Method Summary collapse
Methods included from Resource
#==, #hash, included, #initialize, #inspect, #reference?, #to_h
Class Method Details
.from_response(payload) ⇒ Object
Xero’s /Organisation endpoint returns a one-element “Organisations” array — we unwrap it to a single object.
49 50 51 52 53 54 55 56 |
# File 'lib/xero_kiwi/accounting/organisation.rb', line 49 def self.from_response(payload) return nil if payload.nil? items = payload["Organisations"] return nil if items.nil? || items.empty? new(items.first) end |
Instance Method Details
#demo_company? ⇒ Boolean
58 |
# File 'lib/xero_kiwi/accounting/organisation.rb', line 58 def demo_company? = is_demo_company == true |