Class: Course::Settings::VideosComponent

Inherits:
Component
  • Object
show all
Includes:
ActiveModel::Conversion, EmailSettingsConcern, LessonPlanSettingsConcern
Defined in:
app/models/course/settings/videos_component.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from LessonPlanSettingsConcern

#update_lesson_plan_item_setting

Methods included from EmailSettingsConcern

#email_settings, #update_email_setting

Class Method Details

.component_classObject


14
15
16
# File 'app/models/course/settings/videos_component.rb', line 14

def self.component_class
  Course::VideosComponent
end

.email_setting_itemsObject


7
8
9
10
11
12
# File 'app/models/course/settings/videos_component.rb', line 7

def self.email_setting_items
  {
    video_opening: { enabled_by_default: true },
    video_closing: { enabled_by_default: true }
  }
end

Instance Method Details

#lesson_plan_item_settingsObject


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

def lesson_plan_item_settings
  super.merge(component_title: I18n.t('course.video.videos.index.header'))
end

#showable_in_lesson_plan?Boolean


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

def showable_in_lesson_plan?
  settings.lesson_plan_items ? settings.lesson_plan_items['enabled'] : true
end

#titleString

Returns the title of video component


29
30
31
# File 'app/models/course/settings/videos_component.rb', line 29

def title
  settings.title
end

#title=(title) ⇒ Object

Sets the title of video component


36
37
38
39
# File 'app/models/course/settings/videos_component.rb', line 36

def title=(title)
  title = nil if title.blank?
  settings.title = title
end