Class: Wayfarer::Routing::Matchers::Custom
- Inherits:
-
Object
- Object
- Wayfarer::Routing::Matchers::Custom
- 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
Constructor Details
#initialize(delegate = proc) ⇒ Custom
Returns a new instance of Custom.
9 10 11 |
# File 'lib/wayfarer/routing/matchers/custom.rb', line 9 def initialize(delegate = proc) @delegate = delegate end |
Instance Attribute Details
#delegate ⇒ Object (readonly)
Returns the value of attribute delegate.
7 8 9 |
# File 'lib/wayfarer/routing/matchers/custom.rb', line 7 def delegate @delegate end |
Instance Method Details
#match(url) ⇒ Object
13 14 15 |
# File 'lib/wayfarer/routing/matchers/custom.rb', line 13 def match(url) !!delegate.call(url) end |
#params(_) ⇒ Object
17 18 19 |
# File 'lib/wayfarer/routing/matchers/custom.rb', line 17 def params(_) {} end |