Module: Mihari::Concerns::AutonomousSystemNormalizable
- Extended by:
- ActiveSupport::Concern
- Included in:
- Structs::Censys::AutonomousSystem, Structs::GreyNoise::Metadata, Structs::Onyphe::Result, Structs::Shodan::Match
- Defined in:
- lib/mihari/concerns/autonomous_system_normalizable.rb
Overview
Autonomous System concern
Instance Method Summary collapse
-
#normalize_asn(asn) ⇒ Integer
Normalize ASN value.
Instance Method Details
#normalize_asn(asn) ⇒ Integer
Normalize ASN value
18 19 20 21 22 23 |
# File 'lib/mihari/concerns/autonomous_system_normalizable.rb', line 18 def normalize_asn(asn) return asn if asn.is_a?(Integer) return asn.to_i unless asn.start_with?("AS") asn.delete_prefix("AS").to_i end |