Class: LooseErbs::FilterChain
- Inherits:
-
Object
- Object
- LooseErbs::FilterChain
- Defined in:
- lib/loose_erbs.rb
Instance Method Summary collapse
- #filter(elements) ⇒ Object
-
#initialize(filters) ⇒ FilterChain
constructor
A new instance of FilterChain.
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 |