Class: Mihari::Structs::GreyNoise::Metadata

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

Class Method Summary collapse

Class Method Details

.from_dynamic!(d) ⇒ Object



11
12
13
14
15
16
17
18
# File 'lib/mihari/structs/greynoise.rb', line 11

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    country: d.fetch("country"),
    country_code: d.fetch("country_code"),
    asn: d.fetch("asn")
  )
end