Module: TPEX::Client::Auth
- Included in:
- TPEX::Client
- Defined in:
- lib/tpex/client/auth.rb
Instance Method Summary collapse
Instance Method Details
#login ⇒ Object
6 7 8 9 10 11 12 |
# File 'lib/tpex/client/auth.rb', line 6 def login() data = JSON.generate({"username" => username, "password" => password}) response = post('user/login', data) @cookie = "#{response.session_name}=#{response.sessid}" response end |
#logout ⇒ Object
14 15 16 17 18 |
# File 'lib/tpex/client/auth.rb', line 14 def logout() response = post('user/logout') @cookie = nil response end |