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.



458
459
460
# File 'lib/activemessaging/adapters/asqs.rb', line 458

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.



445
446
447
# File 'lib/activemessaging/adapters/asqs.rb', line 445

def domain
  @domain
end

#nameObject

Returns the value of attribute name.



445
446
447
# File 'lib/activemessaging/adapters/asqs.rb', line 445

def name
  @name
end

#pathinfoObject

Returns the value of attribute pathinfo.



445
446
447
# File 'lib/activemessaging/adapters/asqs.rb', line 445

def pathinfo
  @pathinfo
end

#visibility_timeoutObject

Returns the value of attribute visibility_timeout.



445
446
447
# File 'lib/activemessaging/adapters/asqs.rb', line 445

def visibility_timeout
  @visibility_timeout
end

Class Method Details

.from_url(url) ⇒ Object



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

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



454
455
456
# File 'lib/activemessaging/adapters/asqs.rb', line 454

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

#to_sObject



462
463
464
# File 'lib/activemessaging/adapters/asqs.rb', line 462

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