Sha256: 8c75fa84219fd6ffa430ba5ac08d4f82fec49ad3793ae20cbab244b4e2c1a1bd

Contents?: true

Size: 501 Bytes

Versions: 2

Compression:

Stored size: 501 Bytes

Contents

# frozen_string_literal: true

require_relative 'term'

module UKAcademicCalendar
  # Concrete class allowing instantiation of instances of an Autumn term, for a given academic year
  class AutumnTerm < Term
    # @return [Date] Sep 1st
    def nominal_start_date
      @nominal_start_date ||= Date.today.beginning_of_academic_year.change(year: academic_year)
    end

    # @return [Date] Dec 31st
    def nominal_end_date
      @nominal_end_date ||= nominal_start_date.end_of_year
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
uk_academic_calendar-1.0.1 lib/uk_academic_calendar/autumn_term.rb
uk_academic_calendar-1.0.0 lib/uk_academic_calendar/autumn_term.rb