Class: Wayfarer::Routing::Matchers::Custom
- Inherits:
-
Object
- Object
- Wayfarer::Routing::Matchers::Custom
- Includes:
- Stringify
- Defined in:
- lib/wayfarer/routing/matchers/custom.rb
Instance Attribute Summary collapse
-
#delegate ⇒ Object
readonly
Returns the value of attribute delegate.
Instance Method Summary collapse
-
#initialize(delegate = proc) ⇒ Custom
constructor
A new instance of Custom.
- #match(url) ⇒ Object
- #params(_) ⇒ Object
Methods included from Stringify
Constructor Details
#initialize(delegate = proc) ⇒ Custom
Returns a new instance of Custom.
11 12 13 |
# File 'lib/wayfarer/routing/matchers/custom.rb', line 11 def initialize(delegate = proc) @delegate = delegate end |
Instance Attribute Details
#delegate ⇒ Object (readonly)
Returns the value of attribute delegate.
9 10 11 |
# File 'lib/wayfarer/routing/matchers/custom.rb', line 9 def delegate @delegate end |
Instance Method Details
#match(url) ⇒ Object
15 16 17 |
# File 'lib/wayfarer/routing/matchers/custom.rb', line 15 def match(url) !!delegate.call(url) end |
#params(_) ⇒ Object
19 20 21 |
# File 'lib/wayfarer/routing/matchers/custom.rb', line 19 def params(_) {} end |