Class: Wayfarer::Routing::Matchers::URL
- Inherits:
-
Object
- Object
- Wayfarer::Routing::Matchers::URL
- Includes:
- EmptyParams
- Defined in:
- lib/wayfarer/routing/matchers/url.rb
Instance Attribute Summary collapse
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
- #evaluate(path_finder) ⇒ Object
-
#initialize(url) ⇒ URL
constructor
A new instance of URL.
- #to_h ⇒ Object
Methods included from EmptyParams
Constructor Details
#initialize(url) ⇒ URL
Returns a new instance of URL.
11 12 13 |
# File 'lib/wayfarer/routing/matchers/url.rb', line 11 def initialize(url) @url = Addressable::URI.parse(url) end |
Instance Attribute Details
#url ⇒ Object (readonly)
Returns the value of attribute url.
9 10 11 |
# File 'lib/wayfarer/routing/matchers/url.rb', line 9 def url @url end |
Instance Method Details
#evaluate(path_finder) ⇒ Object
15 16 17 |
# File 'lib/wayfarer/routing/matchers/url.rb', line 15 def evaluate(path_finder) path_finder.uri == url end |
#to_h ⇒ Object
19 20 21 |
# File 'lib/wayfarer/routing/matchers/url.rb', line 19 def to_h { url: url.to_s } end |