Class: Mihari::Structs::GooglePublicDNS::Answer

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

Class Method Summary collapse

Class Method Details

.from_dynamic!(d) ⇒ Object



19
20
21
22
23
24
25
26
27
# File 'lib/mihari/structs/google_public_dns.rb', line 19

def self.from_dynamic!(d)
  d = Types::Hash[d]
  resource_type = INT_TYPE_TO_TYPE[d.fetch("type")]
  new(
    name: d.fetch("name"),
    data: d.fetch("data"),
    resource_type: resource_type
  )
end