compass/lib/compass/core_ext.rb
Erik Bryn 2c89b21f82 Conditionally defining #blank? on String/NilClass
Signed-off-by: Chris Eppstein <chris@eppsteins.net>
2009-04-19 09:44:11 -07:00

15 lines
226 B
Ruby

class String
unless method_defined?(:blank?)
# see if string has any content
def blank?; self.length.zero?; end
end
end
class NilClass
unless method_defined?(:blank?)
def blank?
true
end
end
end