Class: Mihari::Structs::Censys::Location
- Inherits:
-
Dry::Struct
- Object
- Dry::Struct
- Mihari::Structs::Censys::Location
- Defined in:
- lib/mihari/structs/censys.rb
Instance Attribute Summary collapse
- #country ⇒ String? readonly
- #country_code ⇒ String? readonly
Class Method Summary collapse
Instance Method Summary collapse
-
#geolocation ⇒ Mihari::Geolocation
<description>.
Instance Attribute Details
#country ⇒ String? (readonly)
38 |
# File 'lib/mihari/structs/censys.rb', line 38 attribute :country, Types::String.optional |
#country_code ⇒ String? (readonly)
42 |
# File 'lib/mihari/structs/censys.rb', line 42 attribute :country_code, Types::String.optional |
Class Method Details
.from_dynamic!(d) ⇒ Object
62 63 64 65 66 67 68 |
# File 'lib/mihari/structs/censys.rb', line 62 def from_dynamic!(d) d = Types::Hash[d] new( country: d["country"], country_code: d["country_code"] ) end |
Instance Method Details
#geolocation ⇒ Mihari::Geolocation
Returns <description>.
47 48 49 50 51 52 53 54 55 56 |
# File 'lib/mihari/structs/censys.rb', line 47 def geolocation # sometimes Censys overlooks country # then set geolocation as nil return nil if country.nil? Mihari::Models::Geolocation.new( country:, country_code: ) end |