Sha256: 95f0592b8a1aa525ffaa8aebf3ab2a87045d316229b8bb5f4d6fd33dbe793827

Contents?: true

Size: 387 Bytes

Versions: 2

Compression:

Stored size: 387 Bytes

Contents

require 'active_support/core_ext/module/delegation'

module Cal
  class Day

    def initialize(date, calendar)
      @date = date
      @calendar = calendar
    end

    attr_reader :calendar, :date

    delegate :today?, :to => :date

    def ==(other)
      other.is_a?(Day) && other.calendar == calendar && other.date == date
    end

    def number
      date.day
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cal-0.2.0 lib/cal/day.rb
cal-0.1.0 lib/cal/day.rb