Module: Gemmy::Patches::StringPatch::InstanceMethods::IsNumber

Defined in:
lib/gemmy/patches/string_patch.rb

Instance Method Summary collapse

Instance Method Details

#is_number?Boolean

facets

Returns:

  • (Boolean)


135
136
137
# File 'lib/gemmy/patches/string_patch.rb', line 135

def is_number?
  !!self.match(/\A[+-]?\d+?(_?\d+?)*?(\.\d+(_?\d+?)*?)?\Z/)
end