Class: Wayfarer::Routing::Matchers::Host

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#hostObject

Returns the value of attribute host

Returns:

  • (Object)

    the current value of host



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

def host
  @host
end

Instance Method Details

#match(url) ⇒ Object

rubocop:disable Style/CaseEquality



8
9
10
11
12
# File 'lib/wayfarer/routing/matchers/host.rb', line 8

def match(url)
  # url.host excludes the port
  # TODO: Test case, docs
  host === url.authority
end

#params(_) ⇒ Object

rubocop:enable Style/CaseEquality



15
16
17
# File 'lib/wayfarer/routing/matchers/host.rb', line 15

def params(_)
  {}
end