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.
13 14 15 16 |
# File 'lib/censys/search/result.rb', line 13 def initialize(attributes, api) @attributes = attributes @api = api end |
Instance Method Details
#[](name) ⇒ Object
Provides arbitrary access to the result fields.
46 47 48 |
# File 'lib/censys/search/result.rb', line 46 def [](name) @attributes[name] end |
#field?(name) ⇒ Boolean
Determines whether the field exists.
34 35 36 |
# File 'lib/censys/search/result.rb', line 34 def field?(name) @attributes.key?(name) end |
#fields ⇒ Array<String>
The field names.
23 24 25 |
# File 'lib/censys/search/result.rb', line 23 def fields @attributes.keys end |