Class: Mustermann::Router::Rack
- Inherits:
-
Simple
- Object
- Pattern
- Mustermann::RegexpBased
- Simple
- Mustermann::Router::Rack
- Defined in:
- lib/mustermann/router/rack.rb
Overview
Simple pattern based router that allows matching paths to a given Rack application.
Instance Attribute Summary
Attributes inherited from Mustermann::RegexpBased
Instance Method Summary collapse
-
#initialize(env_prefix: "mustermann", params_key: "#{env_prefix}.params", pattern_key: "#{env_prefix}.pattern", **options, &block) ⇒ Rack
constructor
A new instance of Rack.
Methods inherited from Pattern
#===, #=~, #expand, #match, #named_captures, #names, new, #params, supported?, supported_options, #to_s
Constructor Details
#initialize(env_prefix: "mustermann", params_key: "#{env_prefix}.params", pattern_key: "#{env_prefix}.pattern", **options, &block) ⇒ Rack
Returns a new instance of Rack.
24 25 26 27 28 |
# File 'lib/mustermann/router/rack.rb', line 24 def initialize(env_prefix: "mustermann", params_key: "#{env_prefix}.params", pattern_key: "#{env_prefix}.pattern", **, &block) @params_key, @pattern_key = params_key, pattern_key [:default] ||= [404, {"Content-Type" => "text/plain", "X-Cascade" => "pass"}, ["Not Found"]] super(**, &block) end |