Class: String

Inherits:
Object show all
Defined in:
lib/ratchet/utils.rb

Overview

utils.rb #### This file contains some additions to base classes and some other small utility snippets

Instance Method Summary collapse

Instance Method Details

#numeric?Boolean

Returns:

  • (Boolean)


26
27
28
29
30
31
32
# File 'lib/ratchet/utils.rb', line 26

def numeric?
    return false if self.scan('.').length > 1 #more then one floating points - bad
    if to_i == 0 and self != '0' 
        return false
    end
    true
end