module FmRest::Spyke::Model::Auth

Public Instance Methods

logout() click to toggle source

Logs out the database session for this model (and other models using the same credentials). Unlike `logout!`, no exception is raised in case of missing session token.

@return [Boolean] Whether the logout request was sent (it's only

sent if a session token was previously set)
# File lib/fmrest/spyke/model/auth.rb, line 25
def logout
  logout!
  true
rescue FmRest::V1::TokenSession::NoSessionTokenSet
  false
end
logout!() click to toggle source

Logs out the database session for this model (and other models using the same credentials).

@raise [FmRest::V1::TokenSession::NoSessionTokenSet] if no session

token was set (and no request is sent).
# File lib/fmrest/spyke/model/auth.rb, line 15
def logout!
  connection.delete(FmRest::V1.session_path("dummy-token"))
end
request_auth_token() click to toggle source
# File lib/fmrest/spyke/model/auth.rb, line 32
def request_auth_token
  FmRest::V1.request_auth_token(FmRest::V1.auth_connection(fmrest_config))
end
request_auth_token!() click to toggle source
# File lib/fmrest/spyke/model/auth.rb, line 36
def request_auth_token!
  FmRest::V1.request_auth_token!(FmRest::V1.auth_connection(fmrest_config))
end