Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/daru/monkeys.rb

Instance Method Summary collapse

Instance Method Details

#is_number?Boolean

Returns:

  • (Boolean)

100
101
102
103
104
105
106
# File 'lib/daru/monkeys.rb', line 100

def is_number?
  if self =~ /^-?\d+[,.]?\d*(e-?\d+)?$/
    true
  else
    false
  end
end