Class: Mihari::Structs::MMDB::Country

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#autonomous_system_numberString (readonly)

Returns:

  • (String)


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

attribute :autonomous_system_number, Types::String.optional

#iso_codeString (readonly)

Returns:

  • (String)


9
# File 'lib/mihari/structs/mmdb.rb', line 9

attribute :iso_code, Types::String

Class Method Details

.from_dynamic!(d) ⇒ Object



16
17
18
19
20
21
22
# File 'lib/mihari/structs/mmdb.rb', line 16

def from_dynamic!(d)
  d = Types::Hash[d]
  new(
    iso_code: d.fetch("iso_code"),
    autonomous_system_number: d["AutonomousSystemNumber"]
  )
end