Class: Gaku::Semester
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Gaku::Semester
- Defined in:
- app/models/gaku/semester.rb
Instance Method Summary collapse
Instance Method Details
#active? ⇒ Boolean
27 28 29 |
# File 'app/models/gaku/semester.rb', line 27 def active? starting <= Date.today && ending >= Date.today end |
#ended? ⇒ Boolean
35 36 37 |
# File 'app/models/gaku/semester.rb', line 35 def ended? ending < Time.now end |
#to_s ⇒ Object
23 24 25 |
# File 'app/models/gaku/semester.rb', line 23 def to_s "#{starting} / #{ending}" end |
#upcomming? ⇒ Boolean
31 32 33 |
# File 'app/models/gaku/semester.rb', line 31 def upcomming? starting > Date.today end |