Module: CoreExtensions::Object::PresenceCheck

Defined in:
lib/core_extensions/core_extensions.rb

Overview

Object extension to include .present? and .not_present? method

Instance Method Summary collapse

Instance Method Details

#not_present?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/core_extensions/core_extensions.rb', line 11

def not_present?
  to_s.empty?
end

#present?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/core_extensions/core_extensions.rb', line 7

def present?
  !not_present?
end