Class: Mihari::Structs::Onyphe::Result
- Inherits:
-
Dry::Struct
- Object
- Dry::Struct
- Mihari::Structs::Onyphe::Result
- Includes:
- Concerns::AutonomousSystemNormalizable
- Defined in:
- lib/mihari/structs/onyphe.rb
Instance Attribute Summary collapse
- #asn ⇒ String readonly
- #country_code ⇒ String, nll readonly
- #ip ⇒ String readonly
- #metadata ⇒ Hash readonly
Class Method Summary collapse
Instance Method Summary collapse
- #artifact ⇒ Mihari::Models::Artifact
- #as ⇒ Mihari::AutonomousSystem
- #geolocation ⇒ Mihari::Geolocation?
Methods included from Concerns::AutonomousSystemNormalizable
Instance Attribute Details
#asn ⇒ String (readonly)
11 |
# File 'lib/mihari/structs/onyphe.rb', line 11 attribute :asn, Types::String |
#country_code ⇒ String, nll (readonly)
15 |
# File 'lib/mihari/structs/onyphe.rb', line 15 attribute :country_code, Types::String.optional |
Class Method Details
Instance Method Details
#artifact ⇒ Mihari::Models::Artifact
29 30 31 32 33 34 35 36 |
# File 'lib/mihari/structs/onyphe.rb', line 29 def artifact Mihari::Models::Artifact.new( data: ip, metadata:, autonomous_system: as, geolocation: ) end |
#as ⇒ Mihari::AutonomousSystem
53 54 55 |
# File 'lib/mihari/structs/onyphe.rb', line 53 def as Mihari::Models::AutonomousSystem.new(number: normalize_asn(asn)) end |
#geolocation ⇒ Mihari::Geolocation?
41 42 43 44 45 46 47 48 |
# File 'lib/mihari/structs/onyphe.rb', line 41 def geolocation return nil if country_code.nil? Mihari::Models::Geolocation.new( country: NormalizeCountry(country_code, to: :short), country_code: ) end |