Class: Wayfarer::Routing::CustomMatcher

Inherits:
Object
  • Object
show all
Defined in:
lib/wayfarer/routing/custom_matcher.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#delegateObject (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