module GoogleAuthentication

Main module for the gem

Constants

VERSION

Public Class Methods

define_routes?() click to toggle source

Used in the routes file to decide wheter to add routes to the application @return [bool] true iff the GoogleAuthentication model is already defined

# File lib/google_authentication.rb, line 33
def self.define_routes?
  begin
    Object.const_get(model_name.to_s.camelize)
  rescue NameError
    return false
  end
  return true
end
devise_table() click to toggle source

Return a symbol which is used to build devise routes @return [Symbol] a symbol representing the table name used by devise

# File lib/google_authentication.rb, line 44
def self.devise_table
  model_name.to_s.pluralize.to_sym
end
setup() { |self| ... } click to toggle source

Allows config in initializer @yield [self] Allows config in initializer using the same syntax as Devise @yieldparam [GoogleAuthentication] config the module itself @example Changing the authentication setup

GoogleAuthentication.setup do |config|
  config.domain = 'your-google-apps-domain.com'
  config.model_name = :account
end
# File lib/google_authentication.rb, line 26
def self.setup
  yield self
end