Class: Wayfarer::Routing::Matchers::Custom

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

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