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.
284 285 286 287 288 289 290 291 292 |
# File 'lib/nexpose/discovery.rb', line 284 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 |