Class: Treequel::Filter::OrComponent
- Defined in:
- lib/treequel/filter.rb
Overview
An ‘or’ filter component
Instance Attribute Summary collapse
-
#filterlist ⇒ Object
readonly
The list of filters to OR together in the filter string.
Instance Method Summary collapse
-
#add_alternation(filter) ⇒ Object
Add an additional filter to the list of alternatives.
-
#initialize(*filterlist) ⇒ OrComponent
constructor
Create a new ‘or’ filter component with the given
filterlist. -
#to_s ⇒ Object
Stringify the item.
Methods inherited from Component
inherited, #inspect, #promiscuous?
Constructor Details
#initialize(*filterlist) ⇒ OrComponent
Create a new ‘or’ filter component with the given filterlist.
175 176 177 178 |
# File 'lib/treequel/filter.rb', line 175 def initialize( *filterlist ) @filterlist = Treequel::Filter::FilterList.new( filterlist ) super() end |
Instance Attribute Details
#filterlist ⇒ Object (readonly)
The list of filters to OR together in the filter string
181 182 183 |
# File 'lib/treequel/filter.rb', line 181 def filterlist @filterlist end |
Instance Method Details
#add_alternation(filter) ⇒ Object
Add an additional filter to the list of alternatives
189 190 191 |
# File 'lib/treequel/filter.rb', line 189 def add_alternation( filter ) @filterlist << filter end |
#to_s ⇒ Object
Stringify the item
184 185 186 |
# File 'lib/treequel/filter.rb', line 184 def to_s return '|' + @filterlist.to_s end |