Class: Treequel::Filter::FilterList

Inherits:
Object
  • Object
show all
Extended by:
Loggability
Defined in:
lib/treequel/filter.rb

Overview

Filter list component of a Treequel::Filter.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*filters) ⇒ FilterList

Create a new filter list with the given filters in it.



57
58
59
# File 'lib/treequel/filter.rb', line 57

def initialize( *filters )
  @filters = filters.flatten
end

Instance Attribute Details

#filtersObject (readonly)

The filters in the FilterList



66
67
68
# File 'lib/treequel/filter.rb', line 66

def filters
  @filters
end

Instance Method Details

#<<(other) ⇒ Object

Append operator: add the other filter to the list.



76
77
78
79
# File 'lib/treequel/filter.rb', line 76

def <<( other )
  @filters << other
  return self
end

#to_sObject

Return the FilterList as a string.



70
71
72
# File 'lib/treequel/filter.rb', line 70

def to_s
  return self.filters.collect {|f| f.to_s }.join
end