Sha256: 130fa8a8647f1b02c3dbbdcdee688d1be74a3101b2f2c8eaba76221eb9b4ba5d

Contents?: true

Size: 644 Bytes

Versions: 4

Compression:

Stored size: 644 Bytes

Contents

module Vedeu

  # A module for common methods used throughout Vedeu.
  #
  # @api private
  #
  module Common

    # Returns a boolean indicating whether a variable has a useful value.
    #
    # @param variable [String|Symbol|Array|Fixnum] The variable to check.
    # @return [Boolean]
    def defined_value?(variable)
      return true if variable.is_a?(Fixnum)
      return true unless variable.nil? || variable.empty?

      false
    end

    # Returns the array as a sentence.
    #
    # @param array [Array]
    # @return [String]
    def to_sentence(array)
      Vedeu::Sentence.construct(array)
    end

  end # Common

end # Vedeu

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
vedeu-0.4.2 lib/vedeu/support/common.rb
vedeu-0.4.1 lib/vedeu/support/common.rb
vedeu-0.4.0 lib/vedeu/support/common.rb
vedeu-0.3.5 lib/vedeu/support/common.rb