Class: RSMP::AlarmQuery
Overview
Match a specific alarm
Instance Attribute Summary
Attributes inherited from Query
Instance Method Summary collapse
-
#match?(item) ⇒ Boolean
Match an alarm value against a query.
Methods inherited from Query
#done?, #forget, #initialize, #keep, #perform_match
Constructor Details
This class inherits a constructor from RSMP::Query
Instance Method Details
#match?(item) ⇒ Boolean
Match an alarm value against a query
5 6 7 8 9 10 11 12 13 |
# File 'lib/rsmp/collect/alarm_query.rb', line 5 def match? item return false if @want['n'] && @want['n'] != item['n'] if @want['v'].is_a? Regexp return false if item['v'] !~ @want['v'] elsif @want['v'] return false if item['v'] != @want['v'] end true end |