Class: Course::VirtualClassroom

Inherits:
ApplicationRecord show all
Defined in:
app/models/course/virtual_classroom.rb

Defined Under Namespace

Classes: BraincertApiService

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#durationObject


13
14
15
16
# File 'app/models/course/virtual_classroom.rb', line 13

def duration
  return nil unless start_at && end_at
  @duration ||= ((end_at - start_at) / 60).to_i
end

Instance Method Details

#recorded_videos_error?Boolean

Returns:

  • (Boolean)

18
19
20
# File 'app/models/course/virtual_classroom.rb', line 18

def recorded_videos_error?
  recorded_videos_fetched? && !recorded_videos.empty? && recorded_videos[0]['status'] == 'error'
end

#recorded_videos_exist?Boolean

Returns:

  • (Boolean)

22
23
24
# File 'app/models/course/virtual_classroom.rb', line 22

def recorded_videos_exist?
  recorded_videos_fetched? && !recorded_videos_error? && !recorded_videos.empty?
end

#recorded_videos_fetched?Boolean

Returns:

  • (Boolean)

26
27
28
# File 'app/models/course/virtual_classroom.rb', line 26

def recorded_videos_fetched?
  recorded_videos != nil
end