Class: R6API::API
- Inherits:
-
Object
- Object
- R6API::API
- Includes:
- HTTParty, RainbowPlayer, UbisoftProfile
- Defined in:
- lib/r6api.rb
Instance Attribute Summary collapse
-
#auth_token ⇒ Object
Returns the value of attribute auth_token.
-
#ubiid ⇒ Object
Returns the value of attribute ubiid.
Instance Method Summary collapse
- #auth_header ⇒ Object
-
#initialize(ubiid = nil, auth_token = nil) ⇒ API
constructor
A new instance of API.
Methods included from RainbowPlayer
Methods included from UbisoftProfile
Constructor Details
#initialize(ubiid = nil, auth_token = nil) ⇒ API
Returns a new instance of API.
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_token ⇒ Object
Returns the value of attribute auth_token.
27 28 29 |
# File 'lib/r6api.rb', line 27 def auth_token @auth_token end |
#ubiid ⇒ Object
Returns the value of attribute ubiid.
27 28 29 |
# File 'lib/r6api.rb', line 27 def ubiid @ubiid end |
Instance Method Details
#auth_header ⇒ Object
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 |