lib/gameball/models/event.rb in gameball-1.0.1 vs lib/gameball/models/event.rb in gameball-2.0.0

- old
+ new

@@ -1,9 +1,13 @@ module Gameball class Event def self.sendEvent(eventBody) # Validating keys in incoming body - Gameball::Utils.validate(eventBody, ["events", "playerUniqueId"], ["playerAttributes"]) + 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")