Class: Hushed::Client
- Inherits:
-
Object
show all
- Defined in:
- lib/hushed/client.rb
Defined Under Namespace
Classes: InitializationError, InvalidBucketError, InvalidQueueError
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(options = {}) ⇒ Client
Returns a new instance of Client.
15
16
17
18
19
20
21
22
23
24
|
# File 'lib/hushed/client.rb', line 15
def initialize(options = {})
options = options.with_indifferent_access
@buckets = options[:buckets]
@queues = options[:queues]
@client_id = options[:client_id]
@warehouse = options[:warehouse]
@business_unit = options[:business_unit]
@credentials = options.slice(:access_key_id, :secret_access_key)
verify!
end
|
Instance Attribute Details
#business_unit ⇒ Object
Returns the value of attribute business_unit.
13
14
15
|
# File 'lib/hushed/client.rb', line 13
def business_unit
@business_unit
end
|
#client_id ⇒ Object
Returns the value of attribute client_id.
13
14
15
|
# File 'lib/hushed/client.rb', line 13
def client_id
@client_id
end
|
#warehouse ⇒ Object
Returns the value of attribute warehouse.
13
14
15
|
# File 'lib/hushed/client.rb', line 13
def warehouse
@warehouse
end
|
Instance Method Details
#blackboards ⇒ Object
46
47
48
|
# File 'lib/hushed/client.rb', line 46
def blackboards
[to_quiet_bucket, from_quiet_bucket]
end
|
#from_quiet_bucket ⇒ Object
30
31
32
|
# File 'lib/hushed/client.rb', line 30
def from_quiet_bucket
@from_quiet_bucket ||= fetch_bucket(@buckets[:from])
end
|
#from_quiet_queue ⇒ Object
38
39
40
|
# File 'lib/hushed/client.rb', line 38
def from_quiet_queue
@from_quiet_queue ||= fetch_queue(@queues[:from])
end
|
#queues ⇒ Object
50
51
52
|
# File 'lib/hushed/client.rb', line 50
def queues
[to_quiet_queue, from_quiet_queue, quiet_inventory_queue]
end
|
#quiet_inventory_queue ⇒ Object
42
43
44
|
# File 'lib/hushed/client.rb', line 42
def quiet_inventory_queue
@quiet_inventory_queue ||= fetch_queue(@queues[:inventory])
end
|
#to_quiet_bucket ⇒ Object
26
27
28
|
# File 'lib/hushed/client.rb', line 26
def to_quiet_bucket
@to_quiet_bucket ||= fetch_bucket(@buckets[:to])
end
|
#to_quiet_queue ⇒ Object
34
35
36
|
# File 'lib/hushed/client.rb', line 34
def to_quiet_queue
@to_quiet_queue ||= fetch_queue(@queues[:to])
end
|