Class: Object

Inherits:
BasicObject
Defined in:
lib/sinew/core_ext.rb

Overview

blank?/present?

Instance Method Summary collapse

Instance Method Details

#blank?Boolean

Returns:

  • (Boolean)


46
47
48
# File 'lib/sinew/core_ext.rb', line 46

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

#present?Boolean

Returns:

  • (Boolean)


50
51
52
# File 'lib/sinew/core_ext.rb', line 50

def present?
  !blank?
end