Class: ConvertTTS

Inherits:
Object
  • Object
show all
Includes:
Interpipe::Interactor
Defined in:
app/interactors/convert_tts.rb

Constant Summary collapse

DB_KEYS =
[:day, :duration, :first_hour, :parity]

Instance Method Summary collapse

Methods included from Interpipe::Interactor

included, #initialize

Instance Method Details

#perform(timetable_slots:, rooms:, **options) ⇒ Object


12
13
14
15
16
17
18
# File 'app/interactors/convert_tts.rb', line 12

def perform(timetable_slots:, rooms:, **options)
  @rooms = build_rooms_hash(rooms)
  @options = options
  @timetable_slots = timetable_slots.map do |parallel_id, slots|
    slots.reject {|slot| not valid?(slot) }.map { |slot| convert_slot(slot, parallel_id) }
  end.flatten
end

#resultsObject


20
21
22
23
24
# File 'app/interactors/convert_tts.rb', line 20

def results
  {
      timetable_slots: @timetable_slots
  }.merge(@options)
end

#setupObject


8
9
10
# File 'app/interactors/convert_tts.rb', line 8

def setup
  @rooms = {}
end