Sha256: 5668804f878b928c4fa843e3901605f216160242c60e9aa417822a06af50da6b

Contents?: true

Size: 1.21 KB

Versions: 11

Compression:

Stored size: 1.21 KB

Contents

module Gameball
  class Referral
    def self.create_referral(body)
      Gameball::Utils.validate(body, ["playerUniqueId", "playerCode"], ["playerAttributes"])
      if body.has_key?(:playerAttributes)
        # Gameball::Utils.validate(body[:playerAttributes],['displayName','firstName','lastName','email','gender','mobileNumber','dateOfBirth','joinDate'],['custom'])
      end
      res = Gameball::Utils::request("post", "/integrations/referral", body)
      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.create_referral_async(body)
      Gameball::Utils.validate(body, ["playerUniqueId", "playerCode"], ["playerAttributes"])
      if body.has_key?(:playerAttributes)
        # Gameball::Utils.validate(body[:playerAttributes],['displayName','firstName','lastName','email','gender','mobileNumber','dateOfBirth','joinDate'],['custom'])
      end
      Gameball::Utils::request_async("post", "/integrations/referral", body)
    end
  end
end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
gameball-3.1.5 lib/gameball/models/referral.rb
gameball-3.1.4 lib/gameball/models/referral.rb
gameball-2.1.4 lib/gameball/models/referral.rb
gameball-2.1.3 lib/gameball/models/referral.rb
gameball-2.1.1 lib/gameball/models/referral.rb
gameball-2.0.1 lib/gameball/models/referral.rb
gameball-2.0.0 lib/gameball/models/referral.rb
gameball-1.0.1 lib/gameball/models/referral.rb
gameball-1.0.0 lib/gameball/models/referral.rb
alphaSDK-0.2.8 lib/gameball/models/referral.rb
alphaSDK-0.2.7 lib/gameball/models/referral.rb