Skip to content

Instantly share code, notes, and snippets.

@prem
Created September 30, 2008 06:17

Revisions

  1. prem created this gist Sep 30, 2008.
    23 changes: 23 additions & 0 deletions gistfile1.rbx
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,23 @@
    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