Class: Object

Inherits:
BasicObject
Defined in:
lib/stub_requests/core_ext/object/blank.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#blank?Boolean

:nodoc:

Returns:

  • (Boolean)


8
9
10
# File 'lib/stub_requests/core_ext/object/blank.rb', line 8

def blank?
  respond_to?(:empty?) ? !!empty? : !self # rubocop:disable Style/DoubleNegation
end

#presenceObject

:nodoc:



18
19
20
# File 'lib/stub_requests/core_ext/object/blank.rb', line 18

def presence
  self if present?
end

#present?Boolean

:nodoc:

Returns:

  • (Boolean)


13
14
15
# File 'lib/stub_requests/core_ext/object/blank.rb', line 13

def present?
  !blank?
end