Module: FmRest::Spyke::Model::Auth

Extended by:
ActiveSupport::Concern
Included in:
FmRest::Spyke::Model
Defined in:
lib/fmrest/spyke/model/auth.rb

Class Method Summary collapse

Class Method Details

.logoutBoolean

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.

Returns:

  • (Boolean)

    Whether the logout request was sent (it's only sent if a session token was previously set)



25
26
27
28
29
30
# File 'lib/fmrest/spyke/model/auth.rb', line 25

def logout
  logout!
  true
rescue FmRest::V1::TokenSession::NoSessionTokenSet
  false
end

.logout!Object

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

Raises:



15
16
17
# File 'lib/fmrest/spyke/model/auth.rb', line 15

def logout!
  connection.delete(FmRest::V1.session_path("dummy-token"))
end