Class: Censys::Search::Result
- Inherits:
-
Object
- Object
- Censys::Search::Result
- Defined in:
- lib/censys/search/result.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#[](name) ⇒ Object
Provides arbitrary access to the result fields.
-
#field?(name) ⇒ Boolean
Determines whether the field exists.
-
#fields ⇒ Array<String>
The field names.
-
#initialize(attributes, api) ⇒ Result
constructor
Initializes the search result.
Constructor Details
#initialize(attributes, api) ⇒ Result
Initializes the search result.
11 12 13 14 |
# File 'lib/censys/search/result.rb', line 11 def initialize(attributes, api) @attributes = attributes @api = api end |
Instance Method Details
#[](name) ⇒ Object
Provides arbitrary access to the result fields.
44 45 46 |
# File 'lib/censys/search/result.rb', line 44 def [](name) @attributes[name] end |
#field?(name) ⇒ Boolean
Determines whether the field exists.
32 33 34 |
# File 'lib/censys/search/result.rb', line 32 def field?(name) @attributes.key?(name) end |
#fields ⇒ Array<String>
The field names.
21 22 23 |
# File 'lib/censys/search/result.rb', line 21 def fields @attributes.keys end |