Sha256: 0d75efa475feb1cb907b6c15d8f0e5cf47255f279252fb79537e411d6e759019

Contents?: true

Size: 467 Bytes

Versions: 1

Compression:

Stored size: 467 Bytes

Contents

require 'mustermann/pattern'

module Mustermann
  # Matches strings that are identical to the pattern.
  #
  # @example
  #   Mustermann.new('/:foo', type: :identity) === '/bar' # => false
  #
  # @see Pattern
  # @see file:README.md#identity Syntax description in the README
  class Identity < Pattern
    # @param (see Pattern#===)
    # @return (see Pattern#===)
    # @see (see Pattern#===)
    def ===(string)
      unescape(string) == @string
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mustermann-0.0.1 lib/mustermann/identity.rb