Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/benford.rb
Instance Method Summary collapse
Instance Method Details
#first ⇒ Object
56 57 58 |
# File 'lib/benford.rb', line 56 def first self.to_i.to_s[0,1] end |
#is_numeric? ⇒ Boolean
60 61 62 |
# File 'lib/benford.rb', line 60 def is_numeric? self.to_s.match(/\A[+-]?\d+?(\.\d+)?\Z/) == nil ? false : true end |