File Manager

Path: /opt/chef/embedded/lib/ruby/gems/2.7.0/gems/safe_yaml-1.0.5/lib/safe_yaml/parse/

Viewing File: hexadecimal.rb

module SafeYAML
  class Parse
    class Hexadecimal
      MATCHER = /\A[-+]?0x[0-9a-fA-F_]+\Z/.freeze

      def self.value(value)
        # This is safe to do since we already validated the value.
        return Integer(value.gsub(/_/, ""))
      end
    end
  end
end