Class: String
Overview
Add #blank? method to String class.
Instance Method Summary collapse
-
#blank? ⇒ TrueClass, FalseClass
Strips out whitespace then tests if the string is empty.
Instance Method Details
#blank? ⇒ TrueClass, FalseClass
Strips out whitespace then tests if the string is empty.
"".blank? #=> true
" ".blank? #=> true
" hey ho ".blank? #=> false
105 106 107 |
# File 'lib/croesus/core_ext/blank.rb', line 105 def blank? strip.empty? end |