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)
36 |
# File 'lib/mihari/structs/censys.rb', line 36 attribute :country, Types::String.optional |
#country_code ⇒ String? (readonly)
40 |
# File 'lib/mihari/structs/censys.rb', line 40 attribute :country_code, Types::String.optional |
Class Method Details
.from_dynamic!(d) ⇒ Object
60 61 62 63 64 65 66 |
# File 'lib/mihari/structs/censys.rb', line 60 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>.
45 46 47 48 49 50 51 52 53 54 |
# File 'lib/mihari/structs/censys.rb', line 45 def geolocation # sometimes Censys overlooks country # then set geolocation as nil return nil if country.nil? Mihari::Models::Geolocation.new( country: country, country_code: country_code ) end |