# File lib/sinatra/rabbit.rb, line 364 def generate operations.values.reject { |op| op.member }.each { |o| o.generate } operations.values.select { |op| op.member }.each { |o| o.generate } app = ::Sinatra::Application collname = name # Work around Ruby's weird scoping/capture app.send(:define_method, "#{parent.name.to_s}_#{name.to_s.singularize}_url") do |id, subid| api_url_for "#{collname}/#{id}/#{subid}", :full end if index_op = operations[:index] app.send(:define_method, "#{parent.name.to_s}_#{name}_url") do api_url_for index_op.path.gsub(/\/\?$/,''), :full end end end