Class: Knot::Dispatch::Route
- Inherits:
-
Object
- Object
- Knot::Dispatch::Route
- Defined in:
- lib/knot/dispatch/route.rb
Instance Attribute Summary collapse
-
#block ⇒ Object
readonly
Returns the value of attribute block.
-
#http_method ⇒ Object
readonly
Returns the value of attribute http_method.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
-
#initialize(http_method, name, path, &block) ⇒ Route
constructor
A new instance of Route.
- #match?(request) ⇒ Boolean
Constructor Details
#initialize(http_method, name, path, &block) ⇒ Route
Returns a new instance of Route.
8 9 10 |
# File 'lib/knot/dispatch/route.rb', line 8 def initialize(http_method, name, path, &block) @http_method, @name, @path, @block = http_method.to_s.upcase, name, path, block end |
Instance Attribute Details
#block ⇒ Object (readonly)
Returns the value of attribute block.
6 7 8 |
# File 'lib/knot/dispatch/route.rb', line 6 def block @block end |
#http_method ⇒ Object (readonly)
Returns the value of attribute http_method.
6 7 8 |
# File 'lib/knot/dispatch/route.rb', line 6 def http_method @http_method end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/knot/dispatch/route.rb', line 6 def name @name end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
6 7 8 |
# File 'lib/knot/dispatch/route.rb', line 6 def path @path end |