class Authinator::Provider
Attributes
api_key[RW]
client_id[RW]
client_secret[RW]
name[R]
site[RW]
token_url[RW]
user_info_url[RW]
Public Class Methods
new(name, options = {})
click to toggle source
# File lib/authinator/provider.rb, line 11 def initialize(name, options = {}) @name = name @client_id = options.delete :client_id @client_secret = options.delete :client_secret @site = options.delete :site @token_url = options.delete :token_url @api_key = options.delete :api_key @user_info_url = options.delete :user_info_url end
Public Instance Methods
add_secrets(options = {})
click to toggle source
# File lib/authinator/provider.rb, line 21 def add_secrets(options = {}) @client_id = options.delete :client_id if options[:client_id] @client_secret = options.delete :client_secret if options[:client_secret] @api_key = options.delete :api_key if options[:api_key] end
empty?()
click to toggle source
# File lib/authinator/provider.rb, line 48 def empty? to_hash.empty? end
secrets()
click to toggle source
# File lib/authinator/provider.rb, line 27 def secrets sec = {} sec[:client_id] = @client_id if @client_id sec[:client_secret] = @client_secret if @client_secret sec[:api_key] = @api_key if @api_key sec end
to_hash()
click to toggle source
# File lib/authinator/provider.rb, line 36 def to_hash { name: @name, client_id: @client_id, client_secret: @client_secret, site: @site, token_url: @token_url, api_key: @api_key, user_info_url: @user_info_url, } end
Also aliased as: inspect