Module: StrawberryAPI::Client::Sessions
- Included in:
- StrawberryAPI::Client
- Defined in:
- lib/strawberry_api/client/sessions.rb
Instance Method Summary collapse
-
#logged_in? ⇒ Boolean
Determines whether the session is valid.
-
#logout ⇒ Boolean
Closes the current session.
-
#session_info ⇒ StrawberryAPI::User
Fetches the current user information.
Instance Method Details
#logged_in? ⇒ Boolean
Determines whether the session is valid
10 11 12 |
# File 'lib/strawberry_api/client/sessions.rb', line 10 def logged_in? get("/session").success? end |
#logout ⇒ Boolean
Closes the current session
19 20 21 |
# File 'lib/strawberry_api/client/sessions.rb', line 19 def logout delete('/session').success? end |
#session_info ⇒ StrawberryAPI::User
Fetches the current user information
28 29 30 |
# File 'lib/strawberry_api/client/sessions.rb', line 28 def session_info data = get('/session') end |