Class: LapillusServer
Instance Attribute Summary collapse
-
#server ⇒ Object
readonly
Returns the value of attribute server.
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ LapillusServer
constructor
A new instance of LapillusServer.
- #start ⇒ Object
Constructor Details
#initialize(params = {}) ⇒ LapillusServer
Returns a new instance of LapillusServer.
6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/lapillus/lapillus_server.rb', line 6 def initialize(params={}) root_url = params[:root_url] homepage = params[:homepage] port = params[:port] raise "root_url not set!" if root_url.nil? raise "homepage not set!" if homepage.nil? raise "port not set!" if port.nil? @server = WebrickServer.new(port) web_application = WebApplication.new web_application.homepage = homepage server.mount(root_url, web_application) end |
Instance Attribute Details
#server ⇒ Object (readonly)
Returns the value of attribute server.
5 6 7 |
# File 'lib/lapillus/lapillus_server.rb', line 5 def server @server end |
Instance Method Details
#start ⇒ Object
18 19 20 |
# File 'lib/lapillus/lapillus_server.rb', line 18 def start server.start end |