Class: Rfaye::Conf

Inherits:
Object
  • Object
show all
Defined in:
lib/rfaye/conf.rb

Constant Summary collapse

@@config =
{}
@@version =
"0.5.7"
@@secure_prefix =
"s"

Class Method Summary collapse

Class Method Details

.[](x) ⇒ Object



32
33
34
# File 'lib/rfaye/conf.rb', line 32

def self.[] x
	@@config[x]
end

.configObject



16
17
18
# File 'lib/rfaye/conf.rb', line 16

def self.config
	@@config 
end

.load(filename, environment) ⇒ Object

Raises:

  • (ArgumentError)


10
11
12
13
14
# File 'lib/rfaye/conf.rb', line 10

def self.load(filename, environment)
	yaml = YAML.load_file(filename)[environment.to_s]
	raise ArgumentError, "The #{environment} environment does not exist in #{filename}" if yaml.nil?
	yaml.each { |k, v| @@config[k.to_sym] = v }
end

.secure_prefixObject



24
25
26
# File 'lib/rfaye/conf.rb', line 24

def self.secure_prefix
	@@secure_prefix
end

.secure_prefix=(sc) ⇒ Object



28
29
30
# File 'lib/rfaye/conf.rb', line 28

def self.secure_prefix= sc
	@@secure_prefix = sc
end

.versionObject



20
21
22
# File 'lib/rfaye/conf.rb', line 20

def self.version
	@@version 
end