Skip to content

Instantly share code, notes, and snippets.

@prem
Created September 30, 2008 06:17
Show Gist options
  • Save prem/13750 to your computer and use it in GitHub Desktop.
Save prem/13750 to your computer and use it in GitHub Desktop.
module Minerva
module Resources
class ParseQuery
include Waves::Resources::Mixin
include Minerva::Resources::ParseHelper
Formats = [ :json, :html ]
on( :get, ['parseQuery'], :query => { :searchText => true } ) do
ParseHelper.parse_query_term(query)
format = File.extname( path ); format = 'json' if format.empty?
results.send( "to_#{ format }" )
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment