chat_service.rb 511 Bytes
Newer Older
1
# Base class for Chat services
2
# This class is not meant to be used directly, but only to inherrit from.
3
4
5
6
7
8
9
10
11
12
13
14
15
class ChatService < Service
  default_value_for :category, 'chat'

  has_many :chat_users

  def valid_token?(token)
    self.respond_to?(:token) && self.token.present? && ActiveSupport::SecurityUtils.variable_size_secure_compare(token, self.token)
  end

  def supported_events
  end

  def trigger(params)
16
    raise NotImplementedError
17
18
19
20
21
22
  end

  def chat_user_params(params)
    params.permit()
  end
end