Module: Chat::User

Extended by:
ActiveSupport::Concern
Defined in:
lib/chat/user.rb

Instance Method Summary collapse

Instance Method Details

#chat_avatarObject



32
33
34
# File 'lib/chat/user.rb', line 32

def chat_avatar
  send(Chat.user_avatar)
end

#chat_avatar?Boolean

Returns:

  • (Boolean)


36
37
38
# File 'lib/chat/user.rb', line 36

def chat_avatar?
  send("#{Chat.user_avatar}?")
end

#nameObject



20
21
22
# File 'lib/chat/user.rb', line 20

def name
  "#{first_name} #{last_name}"
end

#offlineObject



28
29
30
# File 'lib/chat/user.rb', line 28

def offline
  update(chat_status: "offline")
end

#onlineObject



24
25
26
# File 'lib/chat/user.rb', line 24

def online
  update(chat_status: "online")
end