Sha256: 8165f281407e2a29a1883dd7f2708c3312f705449b142467dc85c296ee0409e9

Contents?: true

Size: 623 Bytes

Versions: 11

Compression:

Stored size: 623 Bytes

Contents

module Vedeu

  # A module for common methods used throughout Vedeu.
  #
  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

11 entries across 11 versions & 1 rubygems

Version Path
vedeu-0.4.13 lib/vedeu/support/common.rb
vedeu-0.4.12 lib/vedeu/support/common.rb
vedeu-0.4.11 lib/vedeu/support/common.rb
vedeu-0.4.10 lib/vedeu/support/common.rb
vedeu-0.4.9 lib/vedeu/support/common.rb
vedeu-0.4.8 lib/vedeu/support/common.rb
vedeu-0.4.7 lib/vedeu/support/common.rb
vedeu-0.4.6 lib/vedeu/support/common.rb
vedeu-0.4.5 lib/vedeu/support/common.rb
vedeu-0.4.4 lib/vedeu/support/common.rb
vedeu-0.4.3 lib/vedeu/support/common.rb