Class: ClockIndicator::OtherMonthCalendar

Inherits:
Object
  • Object
show all
Defined in:
lib/clock_indicator/other_month_calendar.rb

Direct Known Subclasses

LastMonthCalendar, NextMonthCalendar

Instance Method Summary collapse

Constructor Details

#initialize(i = 1) ⇒ OtherMonthCalendar

Returns a new instance of OtherMonthCalendar.



3
4
5
# File 'lib/clock_indicator/other_month_calendar.rb', line 3

def initialize(i = 1)
  @i = i
end

Instance Method Details

#calendarObject



7
8
9
10
11
12
13
14
# File 'lib/clock_indicator/other_month_calendar.rb', line 7

def calendar
  @calendar ||= Gtk::Calendar.new.tap do |c|
    c.display_options = OTHER_CALENDAR_OPTIONS
    c.day             = 0
    c.month           = date.month - 1
    c.year            = date.year
  end
end