Sha256: 8e71871f7d0fee7acb84653e788d72b7cb0955403cebb20492318f4c7d5c0ea2

Contents?: true

Size: 489 Bytes

Versions: 7

Compression:

Stored size: 489 Bytes

Contents

# frozen_string_literal: true

require_relative "./support/monthly_unit"

module TimeBoss
  class Calendar
    class Half < Support::MonthlyUnit
      NUM_MONTHS = 6

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

      # Get a "pretty" representation of this half.
      # @return [String] (e.g. "H2 2020")
      def title
        "H#{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/half.rb
timeboss-1.1.4 lib/timeboss/calendar/half.rb
timeboss-1.1.3 lib/timeboss/calendar/half.rb
timeboss-1.1.2 lib/timeboss/calendar/half.rb
timeboss-1.1.1 lib/timeboss/calendar/half.rb
timeboss-1.1.0 lib/timeboss/calendar/half.rb
timeboss-1.0.5 lib/timeboss/calendar/half.rb