lib/pdk/report/event.rb
# Munges the column number of the event into an Integer.
#
# @param value [Integer, String, Fixnum] The column number.
#
# @return [Integer] the provided value, converted into an Integer if
#   necessary.
Munges the column number of the event into an Integer.
Munges the column number of the event into an Integer .
def sanitise_column(value)
        return nil if value.nil?
        valid_types = [String, Integer]
        if RUBY_VERSION.split('.')[0..1].join('.').to_f < 2.4
          valid_types << Fixnum 
        end
        unless valid_types.include?(value.class)
          raise ArgumentError, _('Column must be an Integer or a String representation of an Integer.')
        end
        if value.is_a?(String) && value !~ %r{\A[0-9]+\Z}
          raise ArgumentError, _('The column number can contain only the digits 0-9.')
        end
        value.to_i
      end
def sanitise_column ( value ) return nil if value . nil? valid_types = [ String , Integer ] if RUBY_VERSION . split ( '.' ) [ 0 .. 1 ] . join ( '.' ) . to_f < 2.4 valid_types << Fixnum end unless valid_types . include? ( value . class ) raise ArgumentError , _ ( 'Column must be an Integer or a String representation of an Integer.' ) end if value . is_a? ( String ) && value !~ %r{ \A [0-9]+ \Z } raise ArgumentError , _ ( 'The column number can contain only the digits 0-9.' ) end value . to_i end
Munges the column number of the event into an Integer.
Munges the column number of the event into an Integer .
# rubocop:disable Lint/UnifiedInteger
the provided value, converted into an Integer if necessary.
the provided value converted into an Integer if necessary .
Integer
value
The column number.
The column number .