class Nexpose::Tag::Criterion

Override of filter criterion to account for proper JSON naming.

Public Class Methods

parse(json) click to toggle source

Create a Criterion object from a JSON-derived Hash.

@param [Hash] json JSON-derived Hash of a Criterion object. @return [Criterion] Parsed object.

# File lib/nexpose/tag/criteria.rb, line 18
def self.parse(json)
  new(json['field_name'], json['operator'], json['values'])
end

Public Instance Methods

to_h() click to toggle source

Convert to Hash, which can be converted to JSON for API calls.

# File lib/nexpose/tag/criteria.rb, line 7
def to_h
  { operator: operator,
    values: Array(value),
    field_name: field }
end