Class: XTeamSchedule::Parser

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash) ⇒ Parser

Returns a new instance of Parser.



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

def initialize(hash)
  self.hash = hash
  self.schedule = XTeamSchedule::Schedule.create!
end

Instance Attribute Details

#hashObject

Returns the value of attribute hash.



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

def hash
  @hash
end

#scheduleObject

Returns the value of attribute schedule.



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

def schedule
  @schedule
end

Class Method Details

.parse(hash) ⇒ Object



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

def self.parse(hash)
  new(hash).parse
end

Instance Method Details

#parseObject



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

def parse
  parse_resource_groups!
  parse_resources!
  parse_assignment_groups!
  parse_assignments!
  parse_working_times!
  parse_interface!
  parse_weekly_working_schedule!
  parse_holidays!
  parse_schedule!
  schedule
end