Class: SuperPoller::QueueUrl

Inherits:
URI::Generic
  • Object
show all
Defined in:
lib/super_poller/queue_url.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.parse(url) ⇒ Object



4
5
6
7
# File 'lib/super_poller/queue_url.rb', line 4

def self.parse(url)
  url = "starling://localhost:22122/#{url}" if url =~ /^[a-zA-Z0-9_-]+$/
  new(*URI.parse(url).send(:component_ary))
end

Instance Method Details

#to_queueObject

Raises:

  • (URI::InvalidURIError)


9
10
11
12
# File 'lib/super_poller/queue_url.rb', line 9

def to_queue
  raise URI::InvalidURIError unless respond_to? "to_#{scheme}_queue"
  send("to_#{scheme}_queue")
end