Module: Responsys::Api::Authentication
Instance Method Summary collapse
Instance Method Details
#logged_in? ⇒ Boolean
23 24 25 |
# File 'lib/responsys/api/authentication.rb', line 23 def logged_in? !(session_id.nil? || jsession_id.nil? || header.nil?) end |
#login ⇒ Object
4 5 6 7 8 9 10 11 |
# File 'lib/responsys/api/authentication.rb', line 4 def login logout if logged_in? response = run(:login, credentials) establish_session_id(response) establish_jsession_id(response) set_session_credentials end |
#logout ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/responsys/api/authentication.rb', line 13 def logout return unless logged_in? begin run_with_credentials(:logout, nil) ensure destroy_session_objects end end |