Class: Pike13::API::V2::Front::Base

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

Overview

Base class for all Front namespace resources Front endpoints use the business subdomain (scoped connection)

Class Method Summary collapse

Class Method Details

.clientObject



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

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
# File 'lib/pike13/api/v2/front/base.rb', line 11

def configure(config)
  @client = Pike13::HTTPClient.new(
    base_url: config.full_url,
    access_token: config.access_token
  )
end