Module: Officepod::Authentication
- Included in:
- Base
- Defined in:
- lib/officepod/authentication.rb
Instance Method Summary collapse
Instance Method Details
#get_cookie(cookie) ⇒ Object
20 21 22 23 24 |
# File 'lib/officepod/authentication.rb', line 20 def () sid_pattern = /(?!SID=)[a-z0-9]+(?=\;)/ result = .match sid_pattern result.to_s end |
#login ⇒ Object
4 5 6 7 8 9 10 11 12 13 |
# File 'lib/officepod/authentication.rb', line 4 def login validates_body response = self.class.post(@end_point, ) result = JSON.parse(response.parsed_response) = (response.headers["set-cookie"]) result["SID"] = result["storage_list"] = storage_auth_list(lang: "ko", cookie: ) result.delete_if { |k,v| ["result", "resultcode", "message"].include? k } result end |
#logout ⇒ Object
15 16 17 18 |
# File 'lib/officepod/authentication.rb', line 15 def logout response = self.class.delete(@end_point, ) response.parsed_response end |