Class: Grenweb::Searcher
- Inherits:
-
Object
- Object
- Grenweb::Searcher
- Includes:
- Rack::Utils
- Defined in:
- lib/cdweb/searcher.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize ⇒ Searcher
constructor
A new instance of Searcher.
Constructor Details
#initialize ⇒ Searcher
Returns a new instance of Searcher.
18 19 |
# File 'lib/cdweb/searcher.rb', line 18 def initialize end |
Instance Method Details
#call(env) ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/cdweb/searcher.rb', line 21 def call(env) @request = Rack::Request.new(env) @query = Query.new(@request) @response = Rack::Response.new @response["Content-Type"] = "text/html; charset=UTF-8" @nth = 3 # マッチした行の前後何行を表示するか @rendeler = HTMLRendeler.new(@request.script_name + '/..') if @request.post? or @request['query'] post_request else search end end |