Class: Pike13::API::V2::Account::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/pike13/api/v2/account/base.rb

Overview

Base class for all Account namespace resources Account endpoints use pike13.com (unscoped connection)

Direct Known Subclasses

Business, Confirmation, Password, Person

Class Method Summary collapse

Class Method Details

.clientObject



19
20
21
22
23
24
25
# File 'lib/pike13/api/v2/account/base.rb', line 19

def client
  # Return this class's client if set, otherwise traverse up to Base
  return @client if instance_variable_defined?(:@client) && @client
  return superclass.client if superclass.respond_to?(:client) && superclass != Object

  raise "Client not configured. Call Pike13.configure first."
end

.configure(config) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/pike13/api/v2/account/base.rb', line 11

def configure(config)
  # Account uses pike13.com by default, but can be overridden
  @client = Pike13::HTTPClient.new(
    base_url: config.,
    access_token: config.access_token
  )
end