Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/ext/string.rb

Instance Method Summary collapse

Instance Method Details

#nonnegative_float?Boolean

Returns:

  • (Boolean)


2
3
4
# File 'lib/ext/string.rb', line 2

def nonnegative_float?
  !!match(/\A\+?\d+(?:\.\d+)?\Z/)
end