Class: JsonRpcObjects::Utils::String
- Inherits:
-
Object
- Object
- JsonRpcObjects::Utils::String
- Defined in:
- lib/json-rpc-objects/utils/string.rb
Overview
String utility functions.
Constant Summary collapse
- NUMERIC =
Holds numeric matcher.
/^\s*-?\d+(?:\.\d+)?\s*$/
Class Method Summary collapse
-
.numeric?(string) ⇒ Boolean
Indicates, string is numeric, so consists of numbers only.
Class Method Details
.numeric?(string) ⇒ Boolean
Indicates, string is numeric, so consists of numbers only.
36 37 38 39 40 41 42 |
# File 'lib/json-rpc-objects/utils/string.rb', line 36 def self.numeric?(string) if string.match(NUMERIC) true else false end end |