class Schedule::Day

Day on a year's Schedule::Schedule

Attributes

events[RW]

Array of SingleDayEvents

month[R]

Public Class Methods

new(month, date) click to toggle source
# File app/models/schedule/day.rb, line 10
def initialize(month, date)
  @date = date
  @month = month
  @events = []
end

Public Instance Methods

day_of_month() click to toggle source

1-31

# File app/models/schedule/day.rb, line 21
def day_of_month
  @date.day
end
day_of_week() click to toggle source

Sunday, Monday, … Saturday

# File app/models/schedule/day.rb, line 26
def day_of_week
    Date::DAYNAMES[@date.wday]
end
other_month?() click to toggle source
# File app/models/schedule/day.rb, line 16
def other_month?
  @date.month != @month.date.month
end
to_s() click to toggle source
# File app/models/schedule/day.rb, line 30
def to_s
  "#<Schedule::Day #{@date.strftime('%x') if @date}>"
end