class Pushould::Client
Attributes
email[R]
password[R]
token[R]
url[R]
Public Class Methods
new(_url, token, _email, _password)
click to toggle source
# File lib/pushould.rb, line 8 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/pushould.rb, line 15 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::Resource.new(@url, verify_ssl: OpenSSL::SSL::VERIFY_NONE).get(params: { account: account_info, data: data }, content_type: 'application/json', accept: 'application/json') end