Class: TopicSubtype

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Serialization
Defined in:
lib/topic_subtype.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id, options) ⇒ TopicSubtype

Returns a new instance of TopicSubtype.



8
9
10
11
# File 'lib/topic_subtype.rb', line 8

def initialize(id, options)
  @id = id
  @options = options
end

Instance Attribute Details

#idObject

Returns the value of attribute id.



6
7
8
# File 'lib/topic_subtype.rb', line 6

def id
  @id
end

#optionsObject

Returns the value of attribute options.



6
7
8
# File 'lib/topic_subtype.rb', line 6

def options
  @options
end

Class Method Details

.listObject



17
18
19
20
# File 'lib/topic_subtype.rb', line 17

def self.list
  return [] unless @archetypes.present?
  @archetypes.values
end

.moderator_warningObject



30
31
32
# File 'lib/topic_subtype.rb', line 30

def self.moderator_warning
  "moderator_warning"
end

.notify_moderatorsObject



34
35
36
# File 'lib/topic_subtype.rb', line 34

def self.notify_moderators
  "notify_moderators"
end

.notify_userObject



38
39
40
# File 'lib/topic_subtype.rb', line 38

def self.notify_user
  "notify_user"
end

.pending_users_reminderObject



42
43
44
# File 'lib/topic_subtype.rb', line 42

def self.pending_users_reminder
  "pending_users"
end

.register(name, options = {}) ⇒ Object



46
47
48
49
# File 'lib/topic_subtype.rb', line 46

def self.register(name, options = {})
  @subtypes ||= {}
  @subtypes[name] = TopicSubtype.new(name, options)
end

.system_messageObject



26
27
28
# File 'lib/topic_subtype.rb', line 26

def self.system_message
  "system_message"
end

.user_to_userObject



22
23
24
# File 'lib/topic_subtype.rb', line 22

def self.user_to_user
  "user_to_user"
end

Instance Method Details

#attributesObject



13
14
15
# File 'lib/topic_subtype.rb', line 13

def attributes
  { "id" => @id, "options" => @options }
end