Class: Flickr::FileTokenCache
- Inherits:
-
BaseTokenCache
- Object
- APIBase
- BaseTokenCache
- Flickr::FileTokenCache
- Defined in:
- lib/flickr/token_cache.rb
Instance Attribute Summary
Attributes inherited from APIBase
Instance Method Summary collapse
- #cache_token(token) ⇒ Object
-
#initialize(filename) ⇒ FileTokenCache
constructor
A new instance of FileTokenCache.
- #load_token ⇒ Object
Constructor Details
#initialize(filename) ⇒ FileTokenCache
Returns a new instance of FileTokenCache.
17 18 19 |
# File 'lib/flickr/token_cache.rb', line 17 def initialize(filename) @cache_file = filename end |
Instance Method Details
#cache_token(token) ⇒ Object
29 30 31 |
# File 'lib/flickr/token_cache.rb', line 29 def cache_token(token) File.open(@cache_file,'w'){ |f| f.write token.to_xml } if token end |