Class: Infuser::TokenRefresher

Inherits:
Object
  • Object
show all
Defined in:
lib/infuser/token_refresher.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(refresh_token) ⇒ TokenRefresher

Returns a new instance of TokenRefresher.



10
11
12
# File 'lib/infuser/token_refresher.rb', line 10

def initialize refresh_token
  @refresh_token = refresh_token
end

Instance Attribute Details

#refresh_tokenObject (readonly)

Returns the value of attribute refresh_token.



8
9
10
# File 'lib/infuser/token_refresher.rb', line 8

def refresh_token
  @refresh_token
end

Instance Method Details

#refreshObject



14
15
16
17
# File 'lib/infuser/token_refresher.rb', line 14

def refresh
  resource = RestClient::Resource.new(endpoint, Infuser::Configuration.api_key, Infuser::Configuration.api_secret)
  JSON.parse resource.post(params)
end