Sha256: 35e2407ed64af0a8edfaad978e96fac47d13dd1488c845c3b0807aadf471094e
Contents?: true
Size: 1.45 KB
Versions: 7
Compression:
Stored size: 1.45 KB
Contents
module Gameball class Event def self.sendEvent(eventBody) # Validating keys in incoming body if(Gameball.api_version=="v3.0") Gameball::Utils.validate(eventBody, ["events", "playerUniqueId"], ["mobile","email"]) else Gameball::Utils.validate(eventBody, ["events", "playerUniqueId"], ["playerAttributes"]) end res = Gameball::Utils::request("post", "/integrations/event", eventBody) # Check for HTTP Success and throws error if not success unless res.kind_of? Net::HTTPSuccess if res.kind_of? Net::HTTPInternalServerError raise Gameball::GameballError.new("An Internal Server Error has occurred") else raise Gameball::GameballError.new(res.body) end else return true end end def self.sendEvent_async(eventBody) # Validating keys in incoming body Gameball::Utils.validate(eventBody, ["events", "playerUniqueId"], ["playerAttributes"]) res = Gameball::Utils::request_async("post", "/integrations/event", eventBody) # Check for HTTP Success and throws error if not success unless res.kind_of? Net::HTTPSuccess if res.kind_of? Net::HTTPInternalServerError raise Gameball::GameballError.new("An Internal Server Error has occurred") else raise Gameball::GameballError.new(res.body) end else return true end end end end
Version data entries
7 entries across 7 versions & 1 rubygems