Class: Nonnative::HTTPServer

Inherits:
Server
  • Object
show all
Defined in:
lib/nonnative/http_server.rb

Defined Under Namespace

Classes: Application

Instance Attribute Summary

Attributes inherited from Server

#port

Instance Method Summary collapse

Methods inherited from Server

#name, #start, #stop

Constructor Details

#initialize(port) ⇒ HTTPServer

Returns a new instance of HTTPServer.



5
6
7
8
9
10
# File 'lib/nonnative/http_server.rb', line 5

def initialize(port)
  Application.set :port, port
  configure Application

  super port
end

Instance Method Details

#configure(http) ⇒ Object



12
13
14
# File 'lib/nonnative/http_server.rb', line 12

def configure(http)
  # Classes will add configuration
end

#perform_startObject



16
17
18
# File 'lib/nonnative/http_server.rb', line 16

def perform_start
  Application.start!
end

#perform_stopObject



20
21
22
# File 'lib/nonnative/http_server.rb', line 20

def perform_stop
  Application.stop!
end