Class: HiveRuby::Server

Inherits:
Object
  • Object
show all
Defined in:
lib/hive_ruby/server.rb

Overview

WebServer

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(device: HiveRuby::Device.new) ⇒ Server

Returns a new instance of Server.



8
9
10
11
12
13
14
15
# File 'lib/hive_ruby/server.rb', line 8

def initialize(device: HiveRuby::Device.new)
  @device = device
  @config = HiveRuby::ServerConfig.new
  setup_get device
  setup_post device

  Rack::Handler::WEBrick.run @config, Port: port
end

Instance Attribute Details

#routesObject (readonly)

Returns the value of attribute routes.



7
8
9
# File 'lib/hive_ruby/server.rb', line 7

def routes
  @routes
end