Module: Aggcat
- Extended by:
- Configurable
- Defined in:
- lib/aggcat.rb,
lib/aggcat/base.rb,
lib/aggcat/client.rb,
lib/aggcat/version.rb,
lib/aggcat/configurable.rb
Defined Under Namespace
Modules: Configurable
Classes: Base, Client
Constant Summary
collapse
- VERSION =
'1.0.1'
Configurable::KEYS
Class Method Summary
collapse
configure
Class Method Details
.client ⇒ Object
18
19
20
21
|
# File 'lib/aggcat.rb', line 18
def client
raise ArgumentError.new('set the client scope first by calling Aggcat.scope(customer_id)') unless defined?(@customer_id)
@client
end
|
.scope(customer_id) ⇒ Object
10
11
12
13
14
15
16
|
# File 'lib/aggcat.rb', line 10
def scope(customer_id)
if !defined?(@customer_id) || @customer_id != customer_id
@customer_id = customer_id
@client = Aggcat::Client.new(options.merge({customer_id: customer_id}))
end
@client
end
|