Class: Ruboty::SqsMonitor::Aws::Sqs
- Inherits:
-
Object
- Object
- Ruboty::SqsMonitor::Aws::Sqs
- Defined in:
- lib/ruboty/sqs_monitor/aws/sqs.rb
Instance Method Summary collapse
- #exists? ⇒ Boolean
-
#initialize(name, options) ⇒ Sqs
constructor
A new instance of Sqs.
Constructor Details
#initialize(name, options) ⇒ Sqs
Returns a new instance of Sqs.
5 6 7 8 9 10 |
# File 'lib/ruboty/sqs_monitor/aws/sqs.rb', line 5 def initialize(name, ) @name = name opts = .select {|k, v| CLIENT_OPTIONS.include? k.to_sym } @client = ::Aws::SQS::Client.new(opts) end |
Instance Method Details
#exists? ⇒ Boolean
12 13 14 15 16 17 |
# File 'lib/ruboty/sqs_monitor/aws/sqs.rb', line 12 def exists? result = @client.list_queues(queue_name_prefix: @name) !!result.queue_urls.find {|url| url.to_s.end_with? @name } rescue false end |