Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/jaspion/kilza.rb

Overview

Ruby class

Instance Method Summary collapse

Instance Method Details

#number?Boolean

Test if the string can be a number

Parameters:

  • str (String)

    string to be tested

Returns:

  • (Boolean)

    true in case of success



17
18
19
# File 'lib/jaspion/kilza.rb', line 17

def number?
  true if Float(self) rescue false
end