Sha256: 267e6e45357ae26add63d41c0d49d23b63f9fc9439a6ca10ca2504bab4ed86ea

Contents?: true

Size: 513 Bytes

Versions: 7

Compression:

Stored size: 513 Bytes

Contents

# frozen_string_literal: true

require_relative "./support/monthly_unit"

module TimeBoss
  class Calendar
    class Month < Support::MonthlyUnit
      NUM_MONTHS = 1

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

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