lib/backburner/connection.rb in backburner-0.0.1 vs lib/backburner/connection.rb in backburner-0.0.2
- old
+ new
@@ -24,17 +24,23 @@
def connect!
@beanstalk ||= Beanstalk::Pool.new(beanstalk_addresses)
end
# Returns the beanstalk queue addresses
- # beanstalk_addresses => ["localhost:11300"]
+ #
+ # @example
+ # beanstalk_addresses => ["localhost:11300"]
+ #
def beanstalk_addresses
uris = self.url.split(/[\s,]+/)
uris.map {|uri| beanstalk_host_and_port(uri)}
end
# Returns a host and port based on the uri_string given
- # beanstalk_host_and_port("beanstalk://localhost") => "localhost:11300"
+ #
+ # @example
+ # beanstalk_host_and_port("beanstalk://localhost") => "localhost:11300"
+ #
def beanstalk_host_and_port(uri_string)
uri = URI.parse(uri_string)
raise(BadURL, uri_string) if uri.scheme != 'beanstalk'
"#{uri.host}:#{uri.port || 11300}"
end
\ No newline at end of file