Class: RSMP::StatusQuery
- Defined in:
- lib/rsmp/collect/message_queries.rb
Overview
Match a specific status response or update
Instance Attribute Summary
Attributes inherited from Query
Instance Method Summary collapse
-
#match?(item) ⇒ Boolean
Match a status value against a query.
Methods inherited from Query
#done?, #initialize, #perform_match
Constructor Details
This class inherits a constructor from RSMP::Query
Instance Method Details
#match?(item) ⇒ Boolean
Match a status value against a query
20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/rsmp/collect/message_queries.rb', line 20 def match? item return nil if @want['sCI'] && @want['sCI'] != item['sCI'] return nil if @want['cO'] && @want['cO'] != item['cO'] return nil if @want['n'] && @want['n'] != item['n'] return false if @want['q'] && @want['q'] != item['q'] if @want['s'].is_a? Regexp return false if item['s'] !~ @want['s'] elsif @want['s'] return false if item['s'] != @want['s'] end true end |