Class: Object

Inherits:
BasicObject
Defined in:
lib/marfa/helpers/classes/object.rb

Overview

Object class extending

Instance Method Summary collapse

Instance Method Details

#blank?true, false

Copied from rails An object is present if it’s not blank.

Returns:

  • (true, false)


7
8
9
# File 'lib/marfa/helpers/classes/object.rb', line 7

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

#present?true, false

Object isn’t blank

Returns:

  • (true, false)


13
14
15
# File 'lib/marfa/helpers/classes/object.rb', line 13

def present?
  !blank?
end