Class: ShopifyTheme::FileFilters
- Inherits:
-
Object
- Object
- ShopifyTheme::FileFilters
- Defined in:
- lib/shopify_theme/file_filters.rb
Instance Method Summary collapse
-
#initialize(*filters) ⇒ FileFilters
constructor
A new instance of FileFilters.
- #select(list) ⇒ Object
Constructor Details
#initialize(*filters) ⇒ FileFilters
Returns a new instance of FileFilters.
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 |