Class: R6API::API

Inherits:
Object
  • Object
show all
Includes:
HTTParty, RainbowPlayer, UbisoftProfile
Defined in:
lib/r6api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from RainbowPlayer

#get_player

Methods included from UbisoftProfile

#get_profile

Constructor Details

#initialize(ubiid = nil, auth_token = nil) ⇒ API

Returns a new instance of API.

Raises:



31
32
33
34
35
# File 'lib/r6api.rb', line 31

def initialize(ubiid=nil, auth_token=nil)
	raise RainbowError, 'Missing Auth token or Ubi AppId' unless ubiid && auth_token
	@ubiid = ubiid
	@auth_token = auth_token
end

Instance Attribute Details

#auth_tokenObject

Returns the value of attribute auth_token.



27
28
29
# File 'lib/r6api.rb', line 27

def auth_token
  @auth_token
end

#ubiidObject

Returns the value of attribute ubiid.



27
28
29
# File 'lib/r6api.rb', line 27

def ubiid
  @ubiid
end

Instance Method Details

#auth_headerObject



37
38
39
40
41
42
43
44
45
# File 'lib/r6api.rb', line 37

def auth_header
	{
		headers: {
			"Ubi-AppId" => ubiid,
			"Authorization" => auth_token
		}
	}

end