Sha256: 535e94033d9d2a87eac4420446f4ea3d48f79db18c9e02504ad7fdffe372e542

Contents?: true

Size: 548 Bytes

Versions: 1

Compression:

Stored size: 548 Bytes

Contents

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

module TimeBoss
  class Calendar
    # Representation of a 6-month period within a 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

1 entries across 1 versions & 1 rubygems

Version Path
timeboss-0.1.0 lib/timeboss/calendar/half.rb