Class: Object

Inherits:
BasicObject
Defined in:
lib/projectlocker_errata/utils/blank.rb

Overview

stolen from ActiveSupport

Instance Method Summary collapse

Instance Method Details

#blank?Boolean

Returns:

  • (Boolean)


4
5
6
# File 'lib/projectlocker_errata/utils/blank.rb', line 4

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

#presenceObject



12
13
14
# File 'lib/projectlocker_errata/utils/blank.rb', line 12

def presence
  self if present?
end

#present?Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/projectlocker_errata/utils/blank.rb', line 8

def present?
  !blank?
end