Class: Shogun::Dispatch::Route
- Inherits:
-
Object
- Object
- Shogun::Dispatch::Route
- Defined in:
- lib/shogun/dispatch/route.rb,
lib/shogun/dispatch/route/null.rb
Defined Under Namespace
Classes: Null
Instance Attribute Summary collapse
-
#control ⇒ Object
readonly
Returns the value of attribute control.
Instance Method Summary collapse
- #as_key ⇒ Object
-
#initialize(namespace:, verb:, matcher:, control:) ⇒ Route
constructor
A new instance of Route.
Constructor Details
#initialize(namespace:, verb:, matcher:, control:) ⇒ Route
Returns a new instance of Route.
8 9 10 11 12 13 |
# File 'lib/shogun/dispatch/route.rb', line 8 def initialize(namespace:, verb:, matcher:, control:) @namespace = namespace @verb = verb @matcher = matcher @control = control end |
Instance Attribute Details
#control ⇒ Object (readonly)
Returns the value of attribute control.
6 7 8 |
# File 'lib/shogun/dispatch/route.rb', line 6 def control @control end |
Instance Method Details
#as_key ⇒ Object
15 16 17 |
# File 'lib/shogun/dispatch/route.rb', line 15 def as_key if expression? then Regexp.new("^#{verb} /#{path}$") else "#{verb} /#{path}" end end |