Module: Sinatra::RabbitHelper

Defined in:
lib/sinatra/rabbit.rb

Instance Method Summary collapse

Instance Method Details

#entry_pointsObject



228
229
230
231
232
233
# File 'lib/sinatra/rabbit.rb', line 228

def entry_points
  collections.values.inject([]) do |m, coll|
    url = url_for coll.operations[:index].path, :full
    m << [ coll.name, url ]
  end
end

#query_url(url, params) ⇒ Object



223
224
225
226
# File 'lib/sinatra/rabbit.rb', line 223

def query_url(url, params)
  return url if params.nil? || params.empty?
  url + "?#{URI.escape(params.collect{|k,v| "#{k}=#{v}"}.join('&'))}"
end