- Defined in:
#filter(*conditions) ⇒ Object
Filter the journal at a high level. Takes any number of arguments; each argument should be a hash representing a condition to filter based on. Fields inside the hash will be ANDed together. Each hash will be ORed with the others. Fields in hashes with Arrays as values are treated as an OR statement, since otherwise they would never match.
20 21 22 23 24 25 26 27 28 29
# File 'lib/systemd/journal/filterable.rb', line 20 def filter(*conditions) clear_filters last_index = conditions.length - 1 conditions.each_with_index do |condition, index| add_filters(condition) add_disjunction unless index == last_index end end