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
# File lib/googleauth/stores/file_token_store.rb, line 42
def initialize options = {}
  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 58
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 48
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 53
def store id, token
  @store.transaction { @store[id] = token }
end