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

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#dataString (readonly)

Returns:

  • (String)


17
# File 'lib/mihari/structs/google_public_dns.rb', line 17

attribute :data, Types::String

#nameString (readonly)

Returns:

  • (String)


13
# File 'lib/mihari/structs/google_public_dns.rb', line 13

attribute :name, Types::String

#resource_typeString (readonly)

Returns:

  • (String)


21
# File 'lib/mihari/structs/google_public_dns.rb', line 21

attribute :resource_type, Types::String

Class Method Details

.from_dynamic!(d) ⇒ Object

Parameters:

  • d (Hash)


27
28
29
30
31
32
33
34
35
# File 'lib/mihari/structs/google_public_dns.rb', line 27

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