Commit 808a3bbc authored by Oleksandr's avatar Oleksandr 🎱

fix options

parent 980cbbad
......@@ -17,14 +17,16 @@ module Wedoops
}
def initialize(options={})
@options = Hash.new
# environment specific settings
if options.has_key?(:environment) && options[:environment] == "sandbox"
self.class.base_uri "https://sandbox.zohoapis.com/oauth/v2/"
options.delete(:environment)
@options[:environment] = "sandbox"
end
#build_url(options)
@logger = ::Logger.new(STDOUT)
@options = Hash.new
options.merge!({response_type: 'code',access_type: 'offline',redirect_uri: 'http://localhost:8000/auth/callback'})
@grant_token = options[:grant_token]
#@options.merge!(grant_token: options[:grant_token] )
......
......@@ -8,7 +8,8 @@ module Wedoops
def initialize(options={})
# environment specific settings
if options.has_key?(:environment) && options[:environment] == "sandbox"
self.class.base_url "https://sandbox.zohoapis.com/oauth/v2/"
self.class.base_uri "https://sandbox.zohoapis.com/oauth/v2/"
options.delete(:environment)
end
@logger = ::Logger.new(STDOUT)
......
......@@ -16,6 +16,7 @@ module Wedoops
# environment specific settings
if options.has_key?(:environment) && options[:environment] == "sandbox"
self.class.base_uri "https://sandbox.zohoapis.com/oauth/v2/"
options.delete(:environment)
end
options.merge!(grant_type: "refresh_token")
......
......@@ -26,6 +26,7 @@ module Wedoops
@token = nil
@token_payload = nil
@token_expires = DateTime.now
@logger.debug("init client: #{@options}")
end
def login?
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment