Class Schedule::Week
In: app/models/schedule/week.rb
Parent: Object

Methods

new   to_s  

Attributes

days  [R]  Array of Days

Public Class methods

start_date must be Sunday month is the owning month, and may be the different (next) month

[Source]

    # File app/models/schedule/week.rb, line 10
10:     def initialize(month, start_date)
11:       @start_date = start_date
12:       if start_date.wday != 0
13:         raise(ArgumentError, "Must start on Sunday")
14:       end
15:       @days = []
16:       (start_date..start_date + 6).each do |date|
17:         @days << Day.new(month, date)    
18:       end
19:     end

Public Instance methods

[Source]

    # File app/models/schedule/week.rb, line 21
21:     def to_s
22:       "#<Schedule::Week #{@start_date.strftime('%x') if @start_date}>"
23:     end

[Validate]