Class: GroupSchedule

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(group) ⇒ GroupSchedule

Returns a new instance of GroupSchedule.



5
6
7
8
# File 'lib/group_scheduler.rb', line 5

def initialize group
  @group = validate_group(group)
  @group_schedule = load_schedule
end

Instance Attribute Details

#group_scheduleObject (readonly)

Returns the value of attribute group_schedule.



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

def group_schedule
  @group_schedule
end

Instance Method Details

#day_schedule(week_day) ⇒ Object



10
11
12
13
# File 'lib/group_scheduler.rb', line 10

def day_schedule week_day
  week_day_obj = Weekday.new(week_day)
  group_schedule[week_day_obj.symbol]
end