Sha256: fe5a41a8aa3b5827c6868174010127096bfa1ba85750cf203f9287930958c16f
Contents?: true
Size: 345 Bytes
Versions: 2
Compression:
Stored size: 345 Bytes
Contents
module ShopifyTheme module Filters class Blacklist attr_reader :patterns def initialize(pattern_strings=[]) @patterns = pattern_strings.map { |p| Regexp.new(p)} end def select(list) list.select do |entry| patterns.none? { |pat| pat.match(entry) } end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
shopify_theme-0.0.25 | lib/shopify_theme/filters/blacklist.rb |
shopify_theme-0.0.24 | lib/shopify_theme/filters/blacklist.rb |