Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/einvoice-qr-encryptor/core_ext/string.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#numeric?Boolean

Check string is numeric or not

Examples:

'abc'.numeric? #=> false
'123'.numeric? #=> true

Returns:

  • (Boolean)


7
8
9
10
11
# File 'lib/einvoice-qr-encryptor/core_ext/string.rb', line 7

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