Module: Sinatra::SimpleAuthentication

Defined in:
lib/sinatra/simple-authentication.rb,
lib/sinatra/simple_authentication/controllers/helpers.rb,
lib/sinatra/simple_authentication/controllers/session.rb,
lib/sinatra/simple_authentication/controllers/defaults.rb,
lib/sinatra/simple_authentication/models/datamapper/user.rb,
lib/sinatra/simple_authentication/models/active_record/user.rb,
lib/sinatra/simple_authentication/models/datamapper/adapter.rb,
lib/sinatra/simple_authentication/models/active_record/adapter.rb,
lib/sinatra/simple_authentication/models/common/instance_methods.rb

Defined Under Namespace

Modules: Controllers, Models

Class Method Summary collapse

Class Method Details

.configure(&block) ⇒ Object



23
24
25
# File 'lib/sinatra/simple-authentication.rb', line 23

def self.configure(&block)
  Sinatra::SimpleAuthentication::Controllers::Defaults.configure(&block)
end

.registered(app) ⇒ Object



9
10
11
# File 'lib/sinatra/simple-authentication.rb', line 9

def self.registered(app)
  Sinatra::SimpleAuthentication::Controllers::Session.registered(app)
end

.require_adapterObject



13
14
15
16
17
18
19
20
21
# File 'lib/sinatra/simple-authentication.rb', line 13

def self.require_adapter()
  if Object.const_defined?("DataMapper")
    require File.join(File.expand_path("..", __FILE__), "simple_authentication/models/datamapper/adapter")
  elsif Object.const_defined?("ActiveRecord")
    require File.join(File.expand_path("..", __FILE__), "simple_authentication/models/active_record/adapter")
  else
    throw "Not DataMapper nor ActiveRecord connection detected."
  end
end