Updated the configuration handling code.
git-svn-id: https://google-api-ruby-client.googlecode.com/svn/trunk@10 c1d61fac-ed7f-fcc1-18f7-ff78120a04ef
This commit is contained in:
1 parent
0d45cbe27b
commit
a6d7aa570e
4 files changed
+94
-1
No files matched your search
@@ -76,7 +76,7 @@ module Google #:nodoc:
|
||||
#
|
||||
# @return [Google::APIClient::OAuth1] The OAuth 1.0a handler.
|
||||
def initialize(options={})
|
||||
if options[:service]
|
||||
if options[:service] && SERVICE_DEFAULTS[options[:service]]
|
||||
@options = DEFAULTS.merge(SERVICE_DEFAULTS[options[:service]])
|
||||
else
|
||||
@options = DEFAULTS.clone
|
||||
@@ -107,6 +107,15 @@ module Google #:nodoc:
|
||||
}
|
||||
)
|
||||
end
|
||||
|
||||
##
|
||||
# Returns the configuration of the handler. Configuration options that
|
||||
# are not recognized by the handler are ignored.
|
||||
#
|
||||
# @return [Hash] The configuration options.
|
||||
def options
|
||||
return @options
|
||||
end
|
||||
|
||||
##
|
||||
# Returns the current request token. Obtains a new request token if
|
||||
@@ -174,6 +183,23 @@ module Google #:nodoc:
|
||||
return @options[:scopes]
|
||||
end
|
||||
|
||||
##
|
||||
# Returns the callback for the handler.
|
||||
#
|
||||
# @return [String] The OAuth 1.0a callback for the consumer.
|
||||
def callback
|
||||
return @options[:callback]
|
||||
end
|
||||
|
||||
##
|
||||
# Returns a human-readable service name to present to the user when they
|
||||
# visit the <code>:authorization_uri</code>.
|
||||
#
|
||||
# @return [String] The display name for the consumer.
|
||||
def display_name
|
||||
return @options[:display_name]
|
||||
end
|
||||
|
||||
##
|
||||
# Returns the consumer key.
|
||||
#
|
||||
|
||||
Reference in new issue
Block a user