Class: Circuitry::Queue
- Inherits:
-
Object
- Object
- Circuitry::Queue
- Includes:
- Services::SQS
- Defined in:
- lib/circuitry/queue.rb
Defined Under Namespace
Classes: Finder
Instance Attribute Summary collapse
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Class Method Summary collapse
Instance Method Summary collapse
- #arn ⇒ Object
- #attribute(name) ⇒ Object
-
#initialize(url) ⇒ Queue
constructor
A new instance of Queue.
- #name ⇒ Object
Methods included from Services::SQS
Constructor Details
#initialize(url) ⇒ Queue
Returns a new instance of Queue.
25 26 27 |
# File 'lib/circuitry/queue.rb', line 25 def initialize(url) self.url = url end |
Instance Attribute Details
#url ⇒ Object
Returns the value of attribute url.
23 24 25 |
# File 'lib/circuitry/queue.rb', line 23 def url @url end |
Class Method Details
Instance Method Details
#arn ⇒ Object
37 38 39 |
# File 'lib/circuitry/queue.rb', line 37 def arn @arn ||= attribute('QueueArn') end |
#attribute(name) ⇒ Object
41 42 43 |
# File 'lib/circuitry/queue.rb', line 41 def attribute(name) sqs.get_queue_attributes(queue_url: url, attribute_names: [name]).attributes[name] end |
#name ⇒ Object
33 34 35 |
# File 'lib/circuitry/queue.rb', line 33 def name url.split('/').last end |