Class: Course::Settings::AnnouncementsComponent

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

Class Method Summary collapse

Instance Method Summary collapse

Methods included from EmailSettingsConcern

#email_settings, #update_email_setting

Class Method Details

.component_classObject


12
13
14
# File 'app/models/course/settings/announcements_component.rb', line 12

def self.component_class
  Course::AnnouncementsComponent
end

.email_setting_itemsObject


8
9
10
# File 'app/models/course/settings/announcements_component.rb', line 8

def self.email_setting_items
  { new_announcement: { enabled_by_default: true } }
end

Instance Method Details

#paginationInteger

Returns the announcement pagination count


34
35
36
# File 'app/models/course/settings/announcements_component.rb', line 34

def pagination
  settings.pagination || 50
end

#pagination=(count) ⇒ Object

Sets the announcement pagination number


41
42
43
# File 'app/models/course/settings/announcements_component.rb', line 41

def pagination=(count)
  settings.pagination = count
end

#titleString

Returns the title of announcements component


19
20
21
# File 'app/models/course/settings/announcements_component.rb', line 19

def title
  settings.title
end

#title=(title) ⇒ Object

Sets the title of announcements component


26
27
28
29
# File 'app/models/course/settings/announcements_component.rb', line 26

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