module ZohoHub

Constants

VERSION

Public Instance Methods

access_token?() click to toggle source
# File lib/zoho_hub.rb, line 57
def access_token?
  return false unless connection

  connection.access_token?
end
configuration() click to toggle source
# File lib/zoho_hub.rb, line 26
def configuration
  @configuration ||= Configuration.new
end
configure() { |configuration| ... } click to toggle source
# File lib/zoho_hub.rb, line 30
def configure
  yield(configuration)
end
connection() click to toggle source
# File lib/zoho_hub.rb, line 47
def connection
  @connection
end
on_refresh(&block) click to toggle source

Callback for when the token is refreshed.

# File lib/zoho_hub.rb, line 35
def on_refresh(&block)
  @connection.on_refresh_cb = block
end
refresh_token?() click to toggle source
# File lib/zoho_hub.rb, line 51
def refresh_token?
  return false unless connection

  connection.refresh_token?
end
root() click to toggle source
# File lib/zoho_hub.rb, line 22
def root
  File.expand_path(File.join(__dir__, '..'))
end
setup_connection(params = {}) click to toggle source
# File lib/zoho_hub.rb, line 39
def setup_connection(params = {})
  raise "ERROR: #{params[:error]}" if params[:error]

  connection_params = params.dup.slice(:access_token, :expires_in, :api_domain, :refresh_token)

  @connection = Connection.new(**connection_params)
end