Module: Linguistics::Latin::Verb::Validation

Included in:
LatinVerb
Defined in:
lib/linguistics/latin/verb/latinverb/validation.rb

Overview

NAME

Validation

DESCRIPTION

This module contains the validity testing methods, when mixed into a LatinVerb, will provide it the ability to ensure its own sanity.

Instance Method Summary collapse

Instance Method Details

#valid?Boolean

DESCRIPTION

This performs the basic task of evaluating the given string (cf. LatinVerb.initialize) for basic sanity.

Here are its basic truths

  1. Get @original_string as an iVar

  2. Derive a classification (+@classification+) from the string

  3. Determine whether the string qualifies the verb as irregular

  4. Identify a stem (+@stem+), provided the verb is regular

Returns:

  • (Boolean)


33
34
35
36
37
# File 'lib/linguistics/latin/verb/latinverb/validation.rb', line 33

def valid?
  !@original_string.nil? &&
  !classification.nil? &&
  ( irregular? ? true : !stem.nil? )
end