Class: FinApps::REST::Sessions
- Inherits:
-
FinAppsCore::REST::Resources
- Object
- FinAppsCore::REST::Resources
- FinApps::REST::Sessions
- Defined in:
- lib/finapps/rest/sessions.rb
Overview
:nodoc:
Constant Summary collapse
- CONSUMER_LOGIN =
'login'
- LOGOUT =
'logout'
Instance Method Summary collapse
Instance Method Details
#create(params, path = nil) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/finapps/rest/sessions.rb', line 9 def create(params, path = nil) return super nil, path if path == LOGOUT fail FinAppsCore::InvalidArgumentsError, 'Invalid argument: params.' unless validates params path ||= CONSUMER_LOGIN begin super params, path rescue FinAppsCore::ApiUnauthenticatedError login_error(path) end end |
#destroy ⇒ Object
22 23 24 |
# File 'lib/finapps/rest/sessions.rb', line 22 def destroy create nil, LOGOUT end |