Class: Bucketrb::Server
- Inherits:
-
Object
- Object
- Bucketrb::Server
- Defined in:
- lib/bucketrb/server.rb
Instance Attribute Summary collapse
-
#host ⇒ Object
readonly
Returns the value of attribute host.
-
#port ⇒ Object
readonly
Returns the value of attribute port.
Instance Method Summary collapse
-
#initialize(app:, host:, port:, logger: nil) ⇒ Server
constructor
A new instance of Server.
- #shutdown ⇒ Object
- #start ⇒ Object
Constructor Details
#initialize(app:, host:, port:, logger: nil) ⇒ Server
Returns a new instance of Server.
10 11 12 13 14 15 16 |
# File 'lib/bucketrb/server.rb', line 10 def initialize(app:, host:, port:, logger: nil) @app = app @host = host @port = port @logger = logger || WEBrick::Log.new($stderr, WEBrick::Log::INFO) @server = build_server end |
Instance Attribute Details
#host ⇒ Object (readonly)
Returns the value of attribute host.
8 9 10 |
# File 'lib/bucketrb/server.rb', line 8 def host @host end |
#port ⇒ Object (readonly)
Returns the value of attribute port.
8 9 10 |
# File 'lib/bucketrb/server.rb', line 8 def port @port end |
Instance Method Details
#shutdown ⇒ Object
23 24 25 |
# File 'lib/bucketrb/server.rb', line 23 def shutdown @server.shutdown end |
#start ⇒ Object
18 19 20 21 |
# File 'lib/bucketrb/server.rb', line 18 def start install_signal_traps if Thread.current == Thread.main @server.start end |