Class: Mihari::Structs::Censys::Result

Inherits:
Dry::Struct
  • Object
show all
Defined in:
lib/mihari/structs/censys.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#hitsArray<Hit> (readonly)

Returns:



187
# File 'lib/mihari/structs/censys.rb', line 187

attribute :hits, Types.Array(Hit)

Returns:



191
# File 'lib/mihari/structs/censys.rb', line 191

attribute :links, Links

#queryString (readonly)

Returns:

  • (String)


179
# File 'lib/mihari/structs/censys.rb', line 179

attribute :query, Types::String

#totalInteger (readonly)

Returns:

  • (Integer)


183
# File 'lib/mihari/structs/censys.rb', line 183

attribute :total, Types::Int

Class Method Details

.from_dynamic!(d) ⇒ Object

Parameters:

  • d (Hash)


204
205
206
207
208
209
210
211
212
# File 'lib/mihari/structs/censys.rb', line 204

def from_dynamic!(d)
  d = Types::Hash[d]
  new(
    query: d.fetch("query"),
    total: d.fetch("total"),
    hits: d.fetch("hits", []).map { |x| Hit.from_dynamic!(x) },
    links: Links.from_dynamic!(d.fetch("links"))
  )
end

Instance Method Details

#artifactsArray<Mihari::Models::Artifact>

Returns:



196
197
198
# File 'lib/mihari/structs/censys.rb', line 196

def artifacts
  hits.map(&:artifact)
end