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



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

def id
  nil
end

#nameObject



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

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

#thredded_anonymous?Boolean

Returns:

  • (Boolean)


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

def thredded_anonymous?
  true
end

#thredded_display_nameObject



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

def thredded_display_name
  to_s
end

#thredded_private_topicsObject



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

def thredded_private_topics
  Thredded::PrivateTopic.none
end

#thredded_user_detailObject



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

def thredded_user_detail
  Thredded::UserDetail.new
end

#thredded_user_preferenceObject



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

def thredded_user_preference
  Thredded::UserPreference.new
end

#to_sObject



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

def to_s
  name
end

#valid?Boolean

Returns:

  • (Boolean)


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

def valid?
  false
end