Class: Wayfarer::Routing::CustomMatcher
- Inherits:
-
Object
- Object
- Wayfarer::Routing::CustomMatcher
- Defined in:
- lib/wayfarer/routing/custom_matcher.rb
Instance Attribute Summary collapse
-
#delegate ⇒ Object
readonly
Returns the value of attribute delegate.
Instance Method Summary collapse
-
#initialize(delegate = proc) ⇒ CustomMatcher
constructor
A new instance of CustomMatcher.
- #match(url) ⇒ Object
- #params(_) ⇒ Object
Constructor Details
#initialize(delegate = proc) ⇒ CustomMatcher
Returns a new instance of CustomMatcher.
8 9 10 |
# File 'lib/wayfarer/routing/custom_matcher.rb', line 8 def initialize(delegate = proc) @delegate = delegate end |
Instance Attribute Details
#delegate ⇒ Object (readonly)
Returns the value of attribute delegate.
6 7 8 |
# File 'lib/wayfarer/routing/custom_matcher.rb', line 6 def delegate @delegate end |
Instance Method Details
#match(url) ⇒ Object
12 13 14 |
# File 'lib/wayfarer/routing/custom_matcher.rb', line 12 def match(url) !!delegate.call(url) end |
#params(_) ⇒ Object
16 17 18 |
# File 'lib/wayfarer/routing/custom_matcher.rb', line 16 def params(_) {} end |