class Censys::Search::Result

Public Class Methods

new(attributes, api) click to toggle source

Initializes the search result.

@param [Hash{String => Object}] attributes

@param [API] api

# File lib/censys/search/result.rb, line 13
def initialize(attributes, api)
  @attributes = attributes
  @api        = api
end

Public Instance Methods

[](name) click to toggle source

Provides arbitrary access to the result fields.

@param [String] name

The dot-separated field name.

@return [Object]

# File lib/censys/search/result.rb, line 46
def [](name)
  @attributes[name]
end
field?(name) click to toggle source

Determines whether the field exists.

@param [String] name

@return [Boolean]

# File lib/censys/search/result.rb, line 34
def field?(name)
  @attributes.key?(name)
end
fields() click to toggle source

The field names.

@return [Array<String>]

# File lib/censys/search/result.rb, line 23
def fields
  @attributes.keys
end