class Xero::Api
Constants
- LOG_TAG
- OAUTH1_ACCESS_TOKEN
- OAUTH1_BASE
- OAUTH1_REDIRECT
- OAUTH1_UNAUTHORIZED
- V2_ENDPOINT_BASE_URL
- VERSION
Attributes
access_token[RW]
consumer_key[RW]
consumer_secret[RW]
endpoint[RW]
token[RW]
token_secret[RW]
Public Class Methods
new(attributes = {})
click to toggle source
# File lib/xero/api.rb, line 26 def initialize(attributes = {}) raise Xero::Api::Error, "missing or blank keyword: token" unless attributes.key?(:token) and !attributes[:token].nil? attributes = default_attributes.merge!(attributes) attributes.each do |attribute, value| public_send("#{attribute}=", value) end @endpoint_url = get_endpoint end
Public Instance Methods
connection(url: endpoint_url)
click to toggle source
# File lib/xero/api.rb, line 41 def connection(url: endpoint_url) @connection ||= authorized_json_connection(url) end
default_attributes()
click to toggle source
# File lib/xero/api.rb, line 35 def default_attributes { endpoint: :accounting } end
endpoint_url()
click to toggle source
# File lib/xero/api.rb, line 45 def endpoint_url @endpoint_url.dup end
Private Instance Methods
get_endpoint()
click to toggle source
# File lib/xero/api.rb, line 51 def get_endpoint V2_ENDPOINT_BASE_URL end