Method: HaveAPI::Client::Authentication::Token#renew
- Defined in:
- lib/haveapi/client/authentication/token.rb
#renew ⇒ Object
43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/haveapi/client/authentication/token.rb', line 43 def renew a = HaveAPI::Client::Action.new( nil, @communicator, :renew, @desc[:resources][:token][:actions][:renew], [] ) ret = HaveAPI::Client::Response.new(a, a.execute({})) raise HaveAPI::Client::ActionFailed, ret unless ret.ok? @valid_to = ret[:valid_to] @valid_to &&= DateTime.iso8601(@valid_to).to_time end |