Class: Nexpose::DiscoveryConnection::Criteria
- Defined in:
- lib/nexpose/discovery.rb
Overview
Override of filter criteria to account for different parsing from JSON.
Instance Attribute Summary
Attributes inherited from Criteria
Class Method Summary collapse
-
.parseHash(hash) ⇒ Criteria
Create a Criteria object from a Hash.
Methods inherited from Criteria
#<<, #_to_payload, #initialize, parse, #to_h, #to_json
Constructor Details
This class inherits a constructor from Nexpose::Criteria
Class Method Details
.parseHash(hash) ⇒ Criteria
Create a Criteria object from a Hash.
272 273 274 275 276 277 278 279 280 |
# File 'lib/nexpose/discovery.rb', line 272 def self.parseHash(hash) # The call returns empty JSON, so default to 'AND' if not present. operator = hash[:operator] || 'AND' ret = Criteria.new([], operator) hash[:criteria].each do |c| ret.criteria << Criterion.parseHash(c) end ret end |