Sha256: ece0b3f52f177f384fe8c49eddf758980f6eedb909171159aa7f9415a2ce00de

Contents?: true

Size: 498 Bytes

Versions: 7

Compression:

Stored size: 498 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

7 entries across 7 versions & 1 rubygems

Version Path
timeboss-1.1.5 lib/timeboss/calendar/quarter.rb
timeboss-1.1.4 lib/timeboss/calendar/quarter.rb
timeboss-1.1.3 lib/timeboss/calendar/quarter.rb
timeboss-1.1.2 lib/timeboss/calendar/quarter.rb
timeboss-1.1.1 lib/timeboss/calendar/quarter.rb
timeboss-1.1.0 lib/timeboss/calendar/quarter.rb
timeboss-1.0.5 lib/timeboss/calendar/quarter.rb