Class: Kawaii::Routing::Route
- Inherits:
-
Object
- Object
- Kawaii::Routing::Route
- Defined in:
- lib/kawaii/routing/route.rb
Instance Attribute Summary collapse
-
#handler ⇒ Object
readonly
Returns the value of attribute handler.
-
#http_method ⇒ Object
readonly
Returns the value of attribute http_method.
-
#mapping ⇒ Object
readonly
Returns the value of attribute mapping.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(path, http_method, mapping = nil, block = nil) ⇒ Route
constructor
A new instance of Route.
Constructor Details
#initialize(path, http_method, mapping = nil, block = nil) ⇒ Route
Returns a new instance of Route.
4 5 6 7 8 9 |
# File 'lib/kawaii/routing/route.rb', line 4 def initialize(path, http_method, mapping = nil, block = nil) @path = path @http_method = http_method @mapping = mapping @handler = route_handler(path, mapping, block) end |
Instance Attribute Details
#handler ⇒ Object (readonly)
Returns the value of attribute handler.
10 11 12 |
# File 'lib/kawaii/routing/route.rb', line 10 def handler @handler end |
#http_method ⇒ Object (readonly)
Returns the value of attribute http_method.
10 11 12 |
# File 'lib/kawaii/routing/route.rb', line 10 def http_method @http_method end |
#mapping ⇒ Object (readonly)
Returns the value of attribute mapping.
10 11 12 |
# File 'lib/kawaii/routing/route.rb', line 10 def mapping @mapping end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
10 11 12 |
# File 'lib/kawaii/routing/route.rb', line 10 def path @path end |
Instance Method Details
#==(other) ⇒ Object
12 13 14 |
# File 'lib/kawaii/routing/route.rb', line 12 def ==(other) path == other.path && http_method == other.http_method end |