Class: Nexpose::Tag::Criteria

Inherits:
Criteria
  • Object
show all
Defined in:
lib/nexpose/tag/criteria.rb

Overview

Override of filter criteria to account for different parsing from JSON.

Instance Attribute Summary

Attributes inherited from Criteria

#criteria, #match

Class Method Summary collapse

Methods inherited from Criteria

#<<, #_to_payload, #initialize, #to_h, #to_json

Constructor Details

This class inherits a constructor from Nexpose::Criteria

Class Method Details

.parse(json) ⇒ Criteria

Create a Criteria object from a JSON-derived Hash.

Parameters:

  • json (Hash)

    JSON-derived Hash of a Criteria object.

Returns:



31
32
33
34
# File 'lib/nexpose/tag/criteria.rb', line 31

def self.parse(json)
  criteria = json['criteria'].map { |c| Criterion.parse(c) }
  new(criteria, json['operator'])
end