Class: ActiveMessaging::Adapters::AmazonSqs::Queue

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of Queue.



452
453
454
# File 'lib/activemessaging/adapters/asqs.rb', line 452

def initialize name, domain, vt=nil
  @name, @pathinfo, @domain, @visibility_timeout = name, pathinfo, domain, vt
end

Instance Attribute Details

#domainObject

Returns the value of attribute domain.



439
440
441
# File 'lib/activemessaging/adapters/asqs.rb', line 439

def domain
  @domain
end

#nameObject

Returns the value of attribute name.



439
440
441
# File 'lib/activemessaging/adapters/asqs.rb', line 439

def name
  @name
end

#pathinfoObject

Returns the value of attribute pathinfo.



439
440
441
# File 'lib/activemessaging/adapters/asqs.rb', line 439

def pathinfo
  @pathinfo
end

#visibility_timeoutObject

Returns the value of attribute visibility_timeout.



439
440
441
# File 'lib/activemessaging/adapters/asqs.rb', line 439

def visibility_timeout
  @visibility_timeout
end

Class Method Details

.from_url(url) ⇒ Object



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

def self.from_url url
  u = URI.parse(url)
  name = u.path.gsub(/\//, "")
  domain  = u.host
  return Queue.new(name,domain) 
end

Instance Method Details

#queue_urlObject



448
449
450
# File 'lib/activemessaging/adapters/asqs.rb', line 448

def queue_url
  "#{pathinfo}/#{name}"
end

#to_sObject



456
457
458
# File 'lib/activemessaging/adapters/asqs.rb', line 456

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