Class: LooseErbs::FilterChain

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

Instance Method Summary collapse

Constructor Details

#initialize(filters) ⇒ FilterChain

Returns a new instance of FilterChain.



28
29
30
# File 'lib/loose_erbs.rb', line 28

def initialize(filters)
  @filters = filters
end

Instance Method Details

#filter(elements) ⇒ Object



32
33
34
35
36
# File 'lib/loose_erbs.rb', line 32

def filter(elements)
  @filters.reduce(elements) do |filtered_elements, filter|
    filtered_elements.filter(&filter)
  end
end