Sha256: f500c5852b0aa291079b6df48428c9b985eee203802f0f3bde52e39f6a389ea3

Contents?: true

Size: 560 Bytes

Versions: 23

Compression:

Stored size: 560 Bytes

Contents

# frozen_string_literal: true

module SlimLint::Matcher
  # Represents a Sexp pattern implementing complex matching logic.
  #
  # Subclasses can implement custom logic to create complex matches that can be
  # reused across linters, DRYing up matching code.
  #
  # @abstract
  class Base
    # Whether this matcher matches the specified object.
    #
    # This must be implemented by subclasses.
    #
    # @param other [Object]
    # @return [Boolean]
    def match?(*)
      raise NotImplementedError, 'Matcher must implement `match?`'
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
slim_lint-0.17.0 lib/slim_lint/matcher/base.rb
slim_lint-0.16.1 lib/slim_lint/matcher/base.rb
slim_lint-0.16.0 lib/slim_lint/matcher/base.rb