Class: BitClust::RequestHandler
- Defined in:
- lib/bitclust/requesthandler.rb
Overview
Actions of BitClust server.
Direct Known Subclasses
Instance Method Summary collapse
- #handle(webrick_req) ⇒ Object
-
#initialize(db, manager) ⇒ RequestHandler
constructor
A new instance of RequestHandler.
Constructor Details
#initialize(db, manager) ⇒ RequestHandler
Returns a new instance of RequestHandler.
22 23 24 25 26 27 28 29 30 |
# File 'lib/bitclust/requesthandler.rb', line 22 def initialize(db, manager) if db.is_a? Array @db, @cdb = db else @db = db end @screenmanager = manager @conf = { :database => @db } end |
Instance Method Details
#handle(webrick_req) ⇒ Object
32 33 34 35 36 37 38 39 40 |
# File 'lib/bitclust/requesthandler.rb', line 32 def handle(webrick_req) _handle(Request.new(webrick_req)) rescue WEBrick::HTTPStatus::Status raise rescue BitClust::NotFoundError => err return not_found_response(err) rescue => err return error_response(err) end |