Sha256: e7f5f7d713afdef53701217bc84258ec80c924e9a3fab8803b21050fa6625a03

Contents?: true

Size: 443 Bytes

Versions: 7

Compression:

Stored size: 443 Bytes

Contents

# frozen_string_literal: true

module Mihari
  module Mixins
    #
    # Autonomous System mixin
    #
    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

7 entries across 7 versions & 1 rubygems

Version Path
mihari-6.3.0 lib/mihari/mixins/autonomous_system.rb
mihari-6.2.0 lib/mihari/mixins/autonomous_system.rb
mihari-6.1.0 lib/mihari/mixins/autonomous_system.rb
mihari-6.0.0 lib/mihari/mixins/autonomous_system.rb
mihari-5.7.2 lib/mihari/mixins/autonomous_system.rb
mihari-5.7.1 lib/mihari/mixins/autonomous_system.rb
mihari-5.7.0 lib/mihari/mixins/autonomous_system.rb