Class: Object

Inherits:
BasicObject
Defined in:
lib/overwrite.rb

Instance Method Summary collapse

Instance Method Details

#blank?Boolean

An object is blank if it's false, empty, or a whitespace string. For example, “”, “ ”, nil, [], and {} are all blank.


5
6
7
# File 'lib/overwrite.rb', line 5

def blank?
  respond_to?(:empty?) ? empty? : !self
end

#numeric?Boolean


9
10
11
# File 'lib/overwrite.rb', line 9

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