Sha256: dc948b059af882e11ec49a9d2b529beb7e7c405dc09aae7d82f9ecace18266be

Contents?: true

Size: 497 Bytes

Versions: 11

Compression:

Stored size: 497 Bytes

Contents

# frozen_string_literal: true
require_relative './support/monthly_unit'

module TimeBoss
  class Calendar
    class Quarter < Support::MonthlyUnit
      NUM_MONTHS = 3

      # Get a simple representation of this quarter.
      # @return [String] (e.g. "2020Q3")
      def name
        "#{year_index}Q#{index}"
      end

      # Get a "pretty" representation of this quarter.
      # @return [String] (e.g. "Q3 2020")
      def title
        "Q#{index} #{year_index}"
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
timeboss-1.0.1 lib/timeboss/calendar/quarter.rb
timeboss-1.0.0 lib/timeboss/calendar/quarter.rb
timeboss-0.3.1 lib/timeboss/calendar/quarter.rb
timeboss-0.3.0 lib/timeboss/calendar/quarter.rb
timeboss-0.2.5 lib/timeboss/calendar/quarter.rb
timeboss-0.2.4 lib/timeboss/calendar/quarter.rb
timeboss-0.2.3 lib/timeboss/calendar/quarter.rb
timeboss-0.2.2 lib/timeboss/calendar/quarter.rb
timeboss-0.2.1 lib/timeboss/calendar/quarter.rb
timeboss-0.2.0 lib/timeboss/calendar/quarter.rb
timeboss-0.1.1 lib/timeboss/calendar/quarter.rb