class Sitefull::Cloud::Auth
Public Class Methods
new(auth_type, options = {})
click to toggle source
# File lib/sitefull-cloud/auth.rb, line 10 def initialize(auth_type, options = {}) @auth = auth_class(auth_type).new(options) end
Public Instance Methods
credentials()
click to toggle source
# File lib/sitefull-cloud/auth.rb, line 27 def credentials return @credentials unless @credentials.nil? token.refresh! @credentials = @auth.credentials(token) end
token()
click to toggle source
# File lib/sitefull-cloud/auth.rb, line 23 def token @token ||= Signet::OAuth2::Client.new(token_options) end
Private Instance Methods
auth_class(auth_type)
click to toggle source
# File lib/sitefull-cloud/auth.rb, line 35 def auth_class(auth_type) require "sitefull-cloud/auth/#{auth_type}" Kernel.const_get "Sitefull::Auth::#{auth_type.capitalize}" end