Sha256: 7e97a353f5f3a4e4213e1146bbf24ea5355e95d72de2f590d30f8c9175b4ea3b

Contents?: true

Size: 560 Bytes

Versions: 5

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

5 entries across 5 versions & 1 rubygems

Version Path
slim_lint_standard-0.0.2.2 lib/slim_lint/matcher/base.rb
slim_lint_standard-0.0.2.1 lib/slim_lint/matcher/base.rb
slim_lint_standard-0.0.2 lib/slim_lint/matcher/base.rb
slim_lint_standard-0.0.1 lib/slim_lint/matcher/base.rb
slim_lint_standard-0.0.0 lib/slim_lint/matcher/base.rb