Class: Midori::Route
- Inherits:
-
Object
- Object
- Midori::Route
- Defined in:
- lib/midori/route.rb
Overview
Class for Midori route
Instance Attribute Summary collapse
-
#function ⇒ Proc
what to do after matched.
-
#method ⇒ String
HTTP method.
-
#middlewares ⇒ Array<Class>
middlewares used in the route.
-
#path ⇒ Regexp
regex to match.
Instance Method Summary collapse
-
#initialize(method, path, function) ⇒ Route
constructor
Define a route.
Constructor Details
#initialize(method, path, function) ⇒ Route
Define a route
14 15 16 17 18 19 |
# File 'lib/midori/route.rb', line 14 def initialize(method, path, function) @method = method @path = path @function = function @middlewares = [] end |
Instance Attribute Details
#function ⇒ Proc
what to do after matched
7 8 9 |
# File 'lib/midori/route.rb', line 7 def function @function end |
#middlewares ⇒ Array<Class>
middlewares used in the route
7 8 9 |
# File 'lib/midori/route.rb', line 7 def middlewares @middlewares end |
#path ⇒ Regexp
regex to match
7 8 9 |
# File 'lib/midori/route.rb', line 7 def path @path end |