Class: Nexpose::Tag::Criterion
- Defined in:
- lib/nexpose/tag/criteria.rb
Overview
Override of filter criterion to account for proper JSON naming.
Instance Attribute Summary
Attributes inherited from Criterion
Class Method Summary collapse
-
.parse(json) ⇒ Criterion
Create a Criterion object from a JSON-derived Hash.
Instance Method Summary collapse
-
#to_h ⇒ Object
Convert to Hash, which can be converted to JSON for API calls.
Methods inherited from Criterion
Constructor Details
This class inherits a constructor from Nexpose::Criterion
Class Method Details
.parse(json) ⇒ Criterion
Create a Criterion object from a JSON-derived Hash.
18 19 20 |
# File 'lib/nexpose/tag/criteria.rb', line 18 def self.parse(json) new(json['field_name'], json['operator'], json['values']) end |
Instance Method Details
#to_h ⇒ Object
Convert to Hash, which can be converted to JSON for API calls.
7 8 9 10 11 |
# File 'lib/nexpose/tag/criteria.rb', line 7 def to_h { operator: operator, values: Array(value), field_name: field } end |