Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/zfaker.rb
Overview
String Class
Instance Method Summary collapse
Instance Method Details
#integer? ⇒ Boolean
4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/zfaker.rb', line 4 def integer? [ # In descending order of likeliness: /^[-+]?[1-9]([0-9]*)?$/, # decimal /^0[0-7]+$/, # octal /^0x[0-9A-Fa-f]+$/, # hexadecimal /^0b[01]+$/ # binary ].each do |match_pattern| return true if self =~ match_pattern end false end |