require 'is_numeric/version'

# Extending the class String to perform checks on string to get
# if is a number
class String
  def numeric?
    !(self !~ /^-?\d+(\.\d*)?$/)
  end
end

require 'is_numeric/version'

# Extending the class String to perform checks on string to get
# if is a number
module IsNumeric
  def numeric?
    !(self !~ /^-?\d+(\.\d*)?$/)
  end
end

String.include IsNumeric

Change IsNumeric to a module and include it to String class instead of openning directly
Change IsNumeric to a module and include it to String class instead of openning directly
