Class: Thredded::NullUser

Instance Method Summary collapse

Methods included from UserPermissions::Admin::None

#thredded_admin?

Methods included from UserPermissions::Moderate::None

#thredded_can_moderate_messageboards

Methods included from UserPermissions::Message::ReadersOfWriteableBoards

#thredded_can_message_users

Methods included from UserPermissions::Write::None

#thredded_can_write_messageboards

Methods included from UserPermissions::Read::All

#thredded_can_read_messageboards

Instance Method Details

#idObject



15
16
17
# File 'app/models/thredded/null_user.rb', line 15

def id
  nil
end

#nameObject



19
20
21
# File 'app/models/thredded/null_user.rb', line 19

def name
  I18n.t('thredded.null_user_name')
end

#thredded_anonymous?Boolean

Returns:

  • (Boolean)


31
32
33
# File 'app/models/thredded/null_user.rb', line 31

def thredded_anonymous?
  true
end

#thredded_display_nameObject



43
44
45
# File 'app/models/thredded/null_user.rb', line 43

def thredded_display_name
  to_s
end

#thredded_private_topicsObject



11
12
13
# File 'app/models/thredded/null_user.rb', line 11

def thredded_private_topics
  Thredded::PrivateTopic.none
end

#thredded_user_detailObject



35
36
37
# File 'app/models/thredded/null_user.rb', line 35

def thredded_user_detail
  Thredded::UserDetail.new
end

#thredded_user_preferenceObject



39
40
41
# File 'app/models/thredded/null_user.rb', line 39

def thredded_user_preference
  Thredded::UserPreference.new
end

#to_sObject



23
24
25
# File 'app/models/thredded/null_user.rb', line 23

def to_s
  name
end

#valid?Boolean

Returns:

  • (Boolean)


27
28
29
# File 'app/models/thredded/null_user.rb', line 27

def valid?
  false
end