Class: Wayfarer::Routing::SchemeMatcher

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(scheme) ⇒ SchemeMatcher

Returns a new instance of SchemeMatcher.



8
9
10
# File 'lib/wayfarer/routing/scheme_matcher.rb', line 8

def initialize(scheme)
  @scheme = scheme
end

Instance Attribute Details

#schemeObject (readonly)

Returns the value of attribute scheme.



6
7
8
# File 'lib/wayfarer/routing/scheme_matcher.rb', line 6

def scheme
  @scheme
end

Instance Method Details

#match(url) ⇒ Object



12
13
14
# File 'lib/wayfarer/routing/scheme_matcher.rb', line 12

def match(url)
  url.scheme == scheme.to_s
end

#params(_) ⇒ Object



16
17
18
# File 'lib/wayfarer/routing/scheme_matcher.rb', line 16

def params(_)
  {}
end