class Google::Auth::ClientId
flows.
Representation of an application’s identity for user authorization
def self.from_file(file)
-
(Google::Auth::ClientID)-
Parameters:
-
file(String, File) --
def self.from_file(file) raise 'File can not be nil.' if file.nil? File.open(file.to_s) do |f| json = f.read config = MultiJson.load(json) from_hash(config) end end
def self.from_hash(config)
-
(Google::Auth::ClientID)-
Parameters:
-
config(hash) --
def self.from_hash(config) raise 'Hash can not be nil.' if config.nil? raw_detail = config[INSTALLED_APP] || config[WEB_APP] raise MISSING_TOP_LEVEL_ELEMENT_ERROR if raw_detail.nil? ClientId.new(raw_detail[CLIENT_ID], raw_detail[CLIENT_SECRET]) end
def initialize(id, secret)
- Note: - Direction instantion is discouraged to avoid embedding IDs
Parameters:
-
secret(String) -- -
id(String) --
def initialize(id, secret) raise 'Client id can not be nil' if id.nil? raise 'Client secret can not be nil' if secret.nil? @id = id @secret = secret end