Method: Vedeu::Common#present?

Defined in:
lib/vedeu/common.rb

#present?(variable) ⇒ Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a boolean indicating whether a variable has a useful value.

Parameters:

  • variable (String|Symbol|Array|Fixnum)

    The variable to check.

Returns:

  • (Boolean)


37
38
39
40
41
42
# File 'lib/vedeu/common.rb', line 37

def present?(variable)
  return true if variable.is_a?(Fixnum)
  return true unless variable.nil? || variable.empty?

  false
end