Class: Mustermann::Identity

Inherits:
Pattern
  • Object
show all
Defined in:
lib/mustermann/identity.rb

Overview

Matches strings that are identical to the pattern.

Examples:

Mustermann.new('/:foo', type: :identity) === '/bar' # => false

See Also:

Instance Method Summary collapse

Methods inherited from Pattern

#=~, #expand, #initialize, #match, #named_captures, #names, new, #params, supported?, supported_options, #to_s

Constructor Details

This class inherits a constructor from Mustermann::Pattern

Instance Method Details

#===(string) ⇒ Boolean

Returns Whether or not the pattern matches the given string

See Also:


15
16
17
# File 'lib/mustermann/identity.rb', line 15

def ===(string)
  unescape(string) == @string
end