Class: XTeamSchedule::Composer

Inherits:
Object
  • Object
show all
Defined in:
lib/xteam_schedule/facilitation/composer.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(schedule) ⇒ Composer

Returns a new instance of Composer.



9
10
11
12
13
# File 'lib/xteam_schedule/facilitation/composer.rb', line 9

def initialize(schedule)
  schedule.save!
  self.schedule = schedule
  self.hash = {}
end

Instance Attribute Details

#hashObject

Returns the value of attribute hash.



3
4
5
# File 'lib/xteam_schedule/facilitation/composer.rb', line 3

def hash
  @hash
end

#scheduleObject

Returns the value of attribute schedule.



3
4
5
# File 'lib/xteam_schedule/facilitation/composer.rb', line 3

def schedule
  @schedule
end

Class Method Details

.compose(schedule) ⇒ Object



5
6
7
# File 'lib/xteam_schedule/facilitation/composer.rb', line 5

def self.compose(schedule)
  new(schedule).compose
end

Instance Method Details

#composeObject



15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/xteam_schedule/facilitation/composer.rb', line 15

def compose
  compose_resource_groups!
  compose_resources!
  compose_assignment_groups!
  compose_assignments!
  compose_working_times!
  compose_interface!
  compose_weekly_working_schedule!
  compose_holidays!
  compose_schedule!
  hash
end