lib/google-directory/config.rb in google-directory-0.0.2 vs lib/google-directory/config.rb in google-directory-0.0.3
- old
+ new
@@ -41,11 +41,11 @@
# token_type:
# issued_at:
# access_token:
# expires_in:
def save_token(token_hash)
- token_hash = token_hash.slice(:token_type, :issued_at, :access_token, :expires_in)
+ token_hash = token_hash.slice('token_type', 'issued_at', 'access_token', 'expires_in')
@token_store and @token_store.save(@scope_name, token_hash)
end
def load_token
@token_store and @token_store.load(@scope_name)
@@ -116,15 +116,15 @@
# @yaml_data[Rails.env.to_s] ||= {}
end
def save( scope_name, token_hash )
data = (@yaml_data[Rails.env.to_s] ||= {})
- data[scope_name.to_s] = token_hash.stringify_keys
+ data[scope_name.to_s] = token_hash
File.open(@yaml_file, 'w') { |file| file.write( YAML::dump(@yaml_data) ) }
end
def load( scope_name )
- data = @yaml_data[Rails.env.to_s] and data = data[scope_name.to_s] and data.symbolize_keys.slice(:token_type, :issued_at, :access_token, :expires_in)
+ data = @yaml_data[Rails.env.to_s] and data = data[scope_name.to_s] and data.slice('token_type', 'issued_at', 'access_token', 'expires_in')
end
end
\ No newline at end of file