Class: ShopifyTheme::FileFilters

Inherits:
Object
  • Object
show all
Defined in:
lib/shopify_theme/file_filters.rb

Instance Method Summary collapse

Constructor Details

#initialize(*filters) ⇒ FileFilters

Returns a new instance of FileFilters.

Raises:

  • (ArgumentError)


7
8
9
10
# File 'lib/shopify_theme/file_filters.rb', line 7

def initialize(*filters)
  raise ArgumentError, "Must have at least one filter to apply" unless filters.length > 0
  @filters = filters
end

Instance Method Details

#select(list) ⇒ Object



12
13
14
15
16
# File 'lib/shopify_theme/file_filters.rb', line 12

def select(list)
  @filters.reduce(list) do |results, filter|
    filter.select(results)
  end
end