Class: Mihari::Structs::Shodan::Result

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

Class Method Summary collapse

Class Method Details

.from_dynamic!(d) ⇒ Object



54
55
56
57
58
59
60
# File 'lib/mihari/structs/shodan.rb', line 54

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    matches: d.fetch("matches", []).map { |x| Match.from_dynamic!(x) },
    total: d.fetch("total")
  )
end