Sha256: 5142ac2d7f1bd0906eb1a334a48de6d843d5fa2030c2f4a5c6fdfe92a4135694

Contents?: true

Size: 587 Bytes

Versions: 14

Compression:

Stored size: 587 Bytes

Contents

# frozen_string_literal: true

require "core"
require "refinements/array"

module Git
  module Lint
    module Kit
      # Represents an regular expression list which may be used as an analyzer setting.
      class FilterList
        using Refinements::Array

        def initialize list = Core::EMPTY_ARRAY
          @list = Array(list).map { |item| Regexp.new item }
        end

        def empty? = list.empty?

        def to_a = list

        alias to_ary to_a

        def to_usage(...) = list.to_usage(...)

        private

        attr_reader :list
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
git-lint-8.8.0 lib/git/lint/kit/filter_list.rb
git-lint-8.7.0 lib/git/lint/kit/filter_list.rb
git-lint-8.6.0 lib/git/lint/kit/filter_list.rb
git-lint-8.5.0 lib/git/lint/kit/filter_list.rb
git-lint-8.4.0 lib/git/lint/kit/filter_list.rb
git-lint-8.3.0 lib/git/lint/kit/filter_list.rb
git-lint-8.2.0 lib/git/lint/kit/filter_list.rb
git-lint-8.1.0 lib/git/lint/kit/filter_list.rb
git-lint-8.0.0 lib/git/lint/kit/filter_list.rb
git-lint-7.5.0 lib/git/lint/kit/filter_list.rb
git-lint-7.3.0 lib/git/lint/kit/filter_list.rb
git-lint-7.2.0 lib/git/lint/kit/filter_list.rb
git-lint-7.1.0 lib/git/lint/kit/filter_list.rb
git-lint-7.0.0 lib/git/lint/kit/filter_list.rb