Sha256: e6362fde7bdd084007103cde69ab68e5ab3963135e954e1bd9efbd231b36e091

Contents?: true

Size: 401 Bytes

Versions: 54

Compression:

Stored size: 401 Bytes

Contents

# frozen_string_literal: true

module Mihari
  module Mixins
    module AutonomousSystem
      #
      # Normalize ASN value
      #
      # @param [String, Integer] asn
      #
      # @return [Integer]
      #
      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
    end
  end
end

Version data entries

54 entries across 54 versions & 1 rubygems

Version Path
mihari-5.6.2 lib/mihari/mixins/autonomous_system.rb
mihari-5.6.1 lib/mihari/mixins/autonomous_system.rb
mihari-5.6.0 lib/mihari/mixins/autonomous_system.rb
mihari-5.5.0 lib/mihari/mixins/autonomous_system.rb
mihari-5.4.9 lib/mihari/mixins/autonomous_system.rb
mihari-5.4.8 lib/mihari/mixins/autonomous_system.rb
mihari-5.4.7 lib/mihari/mixins/autonomous_system.rb
mihari-5.4.6 lib/mihari/mixins/autonomous_system.rb
mihari-5.4.5 lib/mihari/mixins/autonomous_system.rb
mihari-5.4.4 lib/mihari/mixins/autonomous_system.rb
mihari-5.4.3 lib/mihari/mixins/autonomous_system.rb
mihari-5.4.2 lib/mihari/mixins/autonomous_system.rb
mihari-5.4.1 lib/mihari/mixins/autonomous_system.rb
mihari-5.4.0 lib/mihari/mixins/autonomous_system.rb
mihari-5.3.2 lib/mihari/mixins/autonomous_system.rb
mihari-5.3.1 lib/mihari/mixins/autonomous_system.rb
mihari-5.3.0 lib/mihari/mixins/autonomous_system.rb
mihari-5.2.4 lib/mihari/mixins/autonomous_system.rb
mihari-5.2.3 lib/mihari/mixins/autonomous_system.rb
mihari-5.2.2 lib/mihari/mixins/autonomous_system.rb