Class: RubyRest::Webrick::Server
- Inherits:
-
WEBrick::HTTPServer
- Object
- WEBrick::HTTPServer
- RubyRest::Webrick::Server
- Defined in:
- lib/rubyrest/webrick.rb
Overview
The Ruby-on-Rest Webrick adapter implementation
Instance Attribute Summary collapse
-
#app ⇒ Object
readonly
Returns the value of attribute app.
Instance Method Summary collapse
-
#initialize(app) ⇒ Server
constructor
Builds a new Webrick adapter instance for the given application.
-
#up ⇒ Object
Starts the server.
Constructor Details
#initialize(app) ⇒ Server
Builds a new Webrick adapter instance for the given application
13 14 15 16 17 18 |
# File 'lib/rubyrest/webrick.rb', line 13 def initialize( app ) super( :Port => app.config[:http_port], :Logger => app.logger ) @app = app servlet = RubyRest::Webrick::Servlet.new( self ) mount "/", servlet end |
Instance Attribute Details
#app ⇒ Object (readonly)
Returns the value of attribute app.
9 10 11 |
# File 'lib/rubyrest/webrick.rb', line 9 def app @app end |
Instance Method Details
#up ⇒ Object
Starts the server
21 22 23 24 25 26 |
# File 'lib/rubyrest/webrick.rb', line 21 def up [ "INT", "TERM" ].each { |signal| trap( signal ) { shutdown } } start end |