Class: Wayfarer::Routing::HostMatcher

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(host) ⇒ HostMatcher

Returns a new instance of HostMatcher.



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

def initialize(host)
  @host = host
end

Instance Attribute Details

#hostObject (readonly)

Returns the value of attribute host.



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

def host
  @host
end

Instance Method Details

#match(url) ⇒ Object

rubocop:disable Style/CaseEquality



13
14
15
# File 'lib/wayfarer/routing/host_matcher.rb', line 13

def match(url)
  @host === url.host
end

#params(_) ⇒ Object

rubocop:enable Style/CaseEquality



18
19
20
# File 'lib/wayfarer/routing/host_matcher.rb', line 18

def params(_)
  {}
end