Class: Hushed::Client

Inherits:
Object
  • 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_unitObject (readonly)

Returns the value of attribute business_unit.



13
14
15
# File 'lib/hushed/client.rb', line 13

def business_unit
  @business_unit
end

#client_idObject (readonly)

Returns the value of attribute client_id.



13
14
15
# File 'lib/hushed/client.rb', line 13

def client_id
  @client_id
end

#warehouseObject (readonly)

Returns the value of attribute warehouse.



13
14
15
# File 'lib/hushed/client.rb', line 13

def warehouse
  @warehouse
end

Instance Method Details

#from_quiet_bucketObject



30
31
32
# File 'lib/hushed/client.rb', line 30

def from_quiet_bucket
  @from_quiet_bucket ||= fetch_bucket(@buckets[:from])
end

#from_quiet_queueObject



38
39
40
# File 'lib/hushed/client.rb', line 38

def from_quiet_queue
  @from_quiet_queue ||= fetch_queue(@queues[:from])
end

#quiet_inventory_queueObject



42
43
44
# File 'lib/hushed/client.rb', line 42

def quiet_inventory_queue
  @quiet_inventory_queue ||= fetch_queue(@queues[:inventory])
end

#to_quiet_bucketObject



26
27
28
# File 'lib/hushed/client.rb', line 26

def to_quiet_bucket
  @to_quiet_bucket ||= fetch_bucket(@buckets[:to])
end

#to_quiet_queueObject



34
35
36
# File 'lib/hushed/client.rb', line 34

def to_quiet_queue
  @to_quiet_queue ||= fetch_queue(@queues[:to])
end