Class: Wayfarer::Routing::Matchers::Host
- Inherits:
-
Object
- Object
- Wayfarer::Routing::Matchers::Host
- Includes:
- EmptyParams
- Defined in:
- lib/wayfarer/routing/matchers/host.rb
Instance Attribute Summary collapse
-
#host ⇒ Object
readonly
Returns the value of attribute host.
Instance Method Summary collapse
- #evaluate(path_finder) ⇒ Object
-
#initialize(host) ⇒ Host
constructor
A new instance of Host.
- #to_h ⇒ Object
Methods included from EmptyParams
Constructor Details
#initialize(host) ⇒ Host
Returns a new instance of Host.
11 12 13 |
# File 'lib/wayfarer/routing/matchers/host.rb', line 11 def initialize(host) @host = host end |
Instance Attribute Details
#host ⇒ Object (readonly)
Returns the value of attribute host.
9 10 11 |
# File 'lib/wayfarer/routing/matchers/host.rb', line 9 def host @host end |
Instance Method Details
#evaluate(path_finder) ⇒ Object
15 16 17 18 19 |
# File 'lib/wayfarer/routing/matchers/host.rb', line 15 def evaluate(path_finder) # rubocop:disable Style/CaseEquality -- String and Regexp matching @host === path_finder.uri.host # rubocop:enable Style/CaseEquality end |
#to_h ⇒ Object
21 22 23 |
# File 'lib/wayfarer/routing/matchers/host.rb', line 21 def to_h { name: host } end |