Class: Another::Ldap::Proxy::Conf

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/another/ldap/proxy/conf.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(conf) ⇒ Conf

Returns a new instance of Conf.



15
16
17
# File 'lib/another/ldap/proxy/conf.rb', line 15

def initialize(conf)
  @conf = conf
end

Instance Attribute Details

#confObject (readonly)

Returns the value of attribute conf.



13
14
15
# File 'lib/another/ldap/proxy/conf.rb', line 13

def conf
  @conf
end

Class Method Details

.from_file(conf_file) ⇒ Object



23
24
25
26
27
28
# File 'lib/another/ldap/proxy/conf.rb', line 23

def self.from_file(conf_file)
  raise "Configuration file not found: #{conf_file}" unless File.exist?(conf_file)

  conf_data = YAML.safe_load_file(conf_file, symbolize_names: true)
  new(conf_data)
end

Instance Method Details

#debugObject



19
20
21
# File 'lib/another/ldap/proxy/conf.rb', line 19

def debug
  conf[:debug]
end