Class: Warden::Ldap::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/warden/ldap/configuration.rb

Overview

Stores configruation information

Configruation inforamtion is loaded from a configuration block defined within the client application.

Examples:

Standard settings

Warden::Ldap.configure do |c|
  c.config_file = 'path/to/warden_config.yml'
  # ...
end

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



33
34
35
# File 'lib/warden/ldap/configuration.rb', line 33

def initialize
  @logger ||= Warden::Ldap::Logger
end

Class Method Details

.define_setting(name) ⇒ Object



17
18
19
20
# File 'lib/warden/ldap/configuration.rb', line 17

def define_setting(name)
  defined_settings << name
  attr_accessor name
end

.defined_settingsObject



22
23
24
# File 'lib/warden/ldap/configuration.rb', line 22

def defined_settings
  @defined_settings ||= []
end

Instance Method Details

#envObject



37
38
39
40
41
42
43
44
# File 'lib/warden/ldap/configuration.rb', line 37

def env
  if defined? Rails
    Rails.env
  elsif @env.nil?
    raise 'Must define Warden::Ldap.env'
  end
  @env
end