class Realtime::Client

Attributes

email[R]
password[R]
token[R]
url[R]

Public Class Methods

new(_url, token, _email, _password) click to toggle source
# File lib/realtime.rb, line 9
def initialize(_url, token, _email, _password)
  @url = _url
  @token = token
  @email = _email
  @password = _password
end

Public Instance Methods

trigger(room: _room, event: _event, data: _data) click to toggle source
# File lib/realtime.rb, line 16
def trigger(room: _room, event: _event, data: _data)
  account_info = { email: @email, password: @password }.to_json
  data = { room: room,
           event: event,
           token: @token,
           custom: data
         }.to_json
  RestClient.get(@url, params: { account: account_info, data: data }, content_type: 'application/json', accept: 'application/json')
end