Top Level Namespace

Defined Under Namespace

Modules: Authenticator, Birth, MagisterData, Official Classes: ClassRoom, Grade, MagClass, Magister, Person, Profile, Subject, Teacher

Instance Method Summary collapse

Instance Method Details

#validate_date(date) ⇒ Boolean

Validates a date

Parameters:

  • date (String)

Returns:

  • (Boolean)

See Also:

  • get_classes


13
14
15
16
17
18
19
# File 'lib/magister/data.rb', line 13

def validate_date(date)
    format = '%Y-%m-%d'
    DateTime.strptime(date, format)
    true
rescue ArgumentError
    false
end