Class: Barometer::WeatherBug::OauthToken

Inherits:
Object
  • Object
show all
Defined in:
lib/barometer/weather_bug/oauth_token.rb

Instance Method Summary collapse

Constructor Details

#initialize(oauth_token_api) ⇒ OauthToken

Returns a new instance of OauthToken.



7
8
9
10
11
# File 'lib/barometer/weather_bug/oauth_token.rb', line 7

def initialize(oauth_token_api)
  @oauth_token_api = oauth_token_api
  @access_token = nil
  @expires_at = nil
end

Instance Method Details

#access_tokenObject



13
14
15
16
# File 'lib/barometer/weather_bug/oauth_token.rb', line 13

def access_token
  refresh_token if stale_token?
  @access_token
end