Method: Hanami::Utils::Kernel.numeric?

Defined in:
lib/hanami/utils/kernel.rb

.numeric?(arg) ⇒ TrueClass, FalseClass

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Checks if the given argument is a string representation of a number

Parameters:

  • arg (Object)

    the input

Returns:

  • (TrueClass, FalseClass)

Since:

  • 0.8.0

[View source]

1034
1035
1036
# File 'lib/hanami/utils/kernel.rb', line 1034

def self.numeric?(arg)
  !(arg.to_s =~ NUMERIC_MATCHER).nil?
end