Class: Hanami::CLI::Server Private

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

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Since:

  • 2.0.0

Constant Summary collapse

RACK_FALLBACK_OPTIONS =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Since:

  • 2.0.0

{
  host: :Host,
  port: :Port
}.freeze
OVERRIDING_OPTIONS =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Since:

  • 2.0.0

{
  config: :config,
  debug: :debug,
  warn: :warn
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(rack_server: Rack::Server) ⇒ Server

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Server.

Since:

  • 2.0.0



29
30
31
# File 'lib/hanami/cli/server.rb', line 29

def initialize(rack_server: Rack::Server)
  @rack_server = rack_server
end

Instance Attribute Details

#rack_serverObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 2.0.0



10
11
12
# File 'lib/hanami/cli/server.rb', line 10

def rack_server
  @rack_server
end

Instance Method Details

#call(**options) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 2.0.0



35
36
37
38
39
# File 'lib/hanami/cli/server.rb', line 35

def call(**options)
  rack_server.start(Hash[
    extract_rack_fallback_options(options) + extract_overriding_options(options)
  ])
end