class Nexpose::DiscoveryConnection::Criterion

Override of filter criterion to account for proper JSON naming.

Public Class Methods

parseHash(hash) 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/discovery.rb, line 257
def self.parseHash(hash)
  Criterion.new(hash[:field_name],
                hash[:operator],
                hash[: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/discovery.rb, line 246
def to_h
  { operator: operator,
    values: Array(value),
    field_name: field }
end