Class: Varager::AuthToken

Inherits:
OpenAPI::AuthToken
  • Object
show all
Defined in:
lib/varager/auth_token.rb

Instance Method Summary collapse

Constructor Details

#initializeAuthToken

Returns a new instance of AuthToken.



4
5
6
7
# File 'lib/varager/auth_token.rb', line 4

def initialize
  super ({"header" => "Authorization",
        "header_format" => "%s"})
end

Instance Method Details

#new_auth_tokenObject



9
10
11
12
# File 'lib/varager/auth_token.rb', line 9

def new_auth_token()
  auth_response = Varager.auth(body: {user: {email: Varager.user, password: Varager.password}}.to_json)
  update({"token" => auth_response.authentication_token})
end