Sha256: 126a33f5f3bb5c852fbd19ecc2ba4315e4d24399556605d138a372c9a26416cb

Contents?: true

Size: 501 Bytes

Versions: 4

Compression:

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

4 entries across 4 versions & 1 rubygems

Version Path
timeboss-1.0.1 lib/timeboss/calendar/support/month_basis.rb
timeboss-1.0.0 lib/timeboss/calendar/support/month_basis.rb
timeboss-0.3.1 lib/timeboss/calendar/support/month_basis.rb
timeboss-0.3.0 lib/timeboss/calendar/support/month_basis.rb