Class: Mihari::Structs::Censys::V2::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:



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

attribute :hits, Types.Array(Hit)

Returns:



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

attribute :links, Links

#queryString (readonly)

Returns:

  • (String)


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

attribute :query, Types::String

#totalInteger (readonly)

Returns:

  • (Integer)


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

attribute :total, Types::Int

Class Method Details

.from_dynamic!(d) ⇒ Object

Parameters:

  • d (Hash)


207
208
209
210
211
212
213
214
215
# File 'lib/mihari/structs/censys.rb', line 207

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:



199
200
201
# File 'lib/mihari/structs/censys.rb', line 199

def artifacts
  hits.map(&:artifact)
end