Class: RubyRest::Webrick::Server

Inherits:
WEBrick::HTTPServer
  • Object
show all
Defined in:
lib/rubyrest/webrick.rb

Overview

The Ruby-on-Rest Webrick adapter implementation

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#appObject (readonly)

Returns the value of attribute app.



9
10
11
# File 'lib/rubyrest/webrick.rb', line 9

def app
  @app
end

Instance Method Details

#upObject

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