Class: Legato::FilterSet
- Inherits:
-
Object
- Object
- Legato::FilterSet
- Includes:
- Enumerable
- Defined in:
- lib/legato/filter_set.rb
Instance Method Summary collapse
- #<<(filter) ⇒ Object
- #each(&block) ⇒ Object
-
#initialize ⇒ FilterSet
constructor
A new instance of FilterSet.
- #to_a ⇒ Object
- #to_params ⇒ Object
Constructor Details
#initialize ⇒ FilterSet
Returns a new instance of FilterSet.
5 6 7 |
# File 'lib/legato/filter_set.rb', line 5 def initialize @filters = [] end |
Instance Method Details
#<<(filter) ⇒ Object
17 18 19 |
# File 'lib/legato/filter_set.rb', line 17 def <<(filter) @filters << filter end |
#each(&block) ⇒ Object
9 10 11 |
# File 'lib/legato/filter_set.rb', line 9 def each(&block) @filters.each(&block) end |
#to_a ⇒ Object
13 14 15 |
# File 'lib/legato/filter_set.rb', line 13 def to_a @filters end |
#to_params ⇒ Object
21 22 23 24 25 |
# File 'lib/legato/filter_set.rb', line 21 def to_params @filters.inject(nil) do |params, filter| filter.join_with(params) end end |