class Google::Auth::Stores::FileTokenStore

Implementation of user token storage backed by a local YAML file

Public Class Methods

new(options = {}) click to toggle source

Create a new store with the supplied file.

@param [String, File] file

Path to storage file
Calls superclass method
# File lib/googleauth/stores/file_token_store.rb, line 27
def initialize options = {}
  super()
  path = options[:file]
  @store = YAML::Store.new path
end

Public Instance Methods

delete(id) click to toggle source

(see Google::Auth::Stores::TokenStore#delete)

# File lib/googleauth/stores/file_token_store.rb, line 44
def delete id
  @store.transaction { @store.delete id }
end
load(id) click to toggle source

(see Google::Auth::Stores::TokenStore#load)

# File lib/googleauth/stores/file_token_store.rb, line 34
def load id
  @store.transaction { @store[id] }
end
store(id, token) click to toggle source

(see Google::Auth::Stores::TokenStore#store)

# File lib/googleauth/stores/file_token_store.rb, line 39
def store id, token
  @store.transaction { @store[id] = token }
end