Class: Miron::Handler

Inherits:
Object
  • Object
show all
Defined in:
lib/miron.rb,
lib/miron/handler.rb,
lib/miron/handlers/thin.rb,
lib/miron/handlers/puma.rb,
lib/miron/handlers/unicorn.rb,
lib/miron/handlers/webrick.rb

Defined Under Namespace

Classes: Puma, Thin, Unicorn, WEBrick

Class Method Summary collapse

Class Method Details

.get(handler_name) ⇒ Miron::Handler

Parameters:

  • handler_name (String)

    inheritor of Miron::Handler to try and use to run a Miron-backed server

Returns:

  • (Miron::Handler)

    returns constant of handler_name, if it can be found

  • (Miron::Handler)

    returns the newly created Response returns constant of Miron::Handle::WEBrick, if handler_name cannot be found


13
14
15
16
17
18
19
# File 'lib/miron/handler.rb', line 13

def self.get(handler_name)
  if !handler_name.nil? && Miron::Handler.const_defined?(:"#{handler_name.capitalize}")
    Miron::Handler.const_get(:"#{handler_name.capitalize}")
  else
    Miron::Handler::WEBrick
  end
end