Class: Array

Inherits:
Object show all
Defined in:
lib/qipowl/core/monkeypatches.rb

Instance Method Summary collapse

Instance Method Details

#vacant?Boolean

Checks whether an array contains non-nil elements

Returns:

  • (Boolean)

    +true+ if an array does not contain non-nils and +false+ otherwise



15
16
17
# File 'lib/qipowl/core/monkeypatches.rb', line 15

def vacant?
  (self.flatten - [nil]).empty?
end