Module: Sinatra::RabbitHelper

Defined in:
lib/sinatra/rabbit.rb

Instance Method Summary collapse

Instance Method Details

#entry_pointsObject



235
236
237
238
239
240
# File 'lib/sinatra/rabbit.rb', line 235

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



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

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