Module: Vedeu::Common
- Included in:
- Coercions, Vedeu::Config::API, DSL::Interface, DSL::Keymap, DisplayBuffer, HTMLChar, Repository, Style
- Defined in:
- lib/vedeu/support/common.rb
Overview
A module for common methods used throughout Vedeu.
Instance Method Summary collapse
-
#defined_value?(variable) ⇒ Boolean
Returns a boolean indicating whether a variable has a useful value.
-
#to_sentence(array) ⇒ String
Returns the array as a sentence.
Instance Method Details
#defined_value?(variable) ⇒ Boolean
Returns a boolean indicating whether a variable has a useful value.
11 12 13 14 15 16 |
# File 'lib/vedeu/support/common.rb', line 11 def defined_value?(variable) return true if variable.is_a?(Fixnum) return true unless variable.nil? || variable.empty? false end |
#to_sentence(array) ⇒ String
Returns the array as a sentence.
22 23 24 |
# File 'lib/vedeu/support/common.rb', line 22 def to_sentence(array) Vedeu::Sentence.construct(array) end |