Sha256: 66a7dd6074ebe97dd6cd87cdf9a8b9ad1235ec52dfeaa2b407ad7a9210f275ba

Contents?: true

Size: 499 Bytes

Versions: 7

Compression:

Stored size: 499 Bytes

Contents

module TimeBoss
  class Calendar
    module Support
      # @abstract
      # A MonthBasis must define a `#start_date` and `#end_date` method.
      # These methods should be calculated based on the incoming `#year` and `#month` values.
      class MonthBasis
        attr_reader :year, :month

        def initialize(year, month)
          @year = year
          @month = month
        end

        def to_range
          @_to_range ||= start_date..end_date
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

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