Class: ActiveMessaging::Adapters::Sqs::Queue

Inherits:
Object
  • Object
show all
Defined in:
lib/activemessaging/adapters/sqs.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, url, vt = nil) ⇒ Queue

Returns a new instance of Queue.



451
452
453
# File 'lib/activemessaging/adapters/sqs.rb', line 451

def initialize name, url, vt=nil
  @name, @url, @visibility_timeout = name, url, vt
end

Instance Attribute Details

#domainObject

Returns the value of attribute domain.



438
439
440
# File 'lib/activemessaging/adapters/sqs.rb', line 438

def domain
  @domain
end

#nameObject

Returns the value of attribute name.



438
439
440
# File 'lib/activemessaging/adapters/sqs.rb', line 438

def name
  @name
end

#pathinfoObject

Returns the value of attribute pathinfo.



438
439
440
# File 'lib/activemessaging/adapters/sqs.rb', line 438

def pathinfo
  @pathinfo
end

#urlObject

Returns the value of attribute url.



438
439
440
# File 'lib/activemessaging/adapters/sqs.rb', line 438

def url
  @url
end

#visibility_timeoutObject

Returns the value of attribute visibility_timeout.



438
439
440
# File 'lib/activemessaging/adapters/sqs.rb', line 438

def visibility_timeout
  @visibility_timeout
end

Class Method Details

.from_url(url) ⇒ Object



440
441
442
443
444
445
# File 'lib/activemessaging/adapters/sqs.rb', line 440

def self.from_url url
  uri = URI.parse(url)
  name = uri.path.split('/').last
  domain = uri.host
  return Queue.new(name, uri)
end

Instance Method Details

#queue_urlObject



447
448
449
# File 'lib/activemessaging/adapters/sqs.rb', line 447

def queue_url
  url.to_s
end

#to_sObject



455
456
457
# File 'lib/activemessaging/adapters/sqs.rb', line 455

def to_s
  "<AmazonSQS::Queue name='#{name}' url='#{url}' visibility_timeout='#{visibility_timeout}'>"
end