Class: Rfaye::Conf
- Inherits:
-
Object
- Object
- Rfaye::Conf
- Defined in:
- lib/rfaye/conf.rb
Constant Summary collapse
- @@config =
{}
- @@version =
"0.5.7"
- @@secure_prefix =
"s"
Class Method Summary collapse
- .[](x) ⇒ Object
- .config ⇒ Object
- .load(filename, environment) ⇒ Object
- .secure_prefix ⇒ Object
- .secure_prefix=(sc) ⇒ Object
- .version ⇒ Object
Class Method Details
.[](x) ⇒ Object
32 33 34 |
# File 'lib/rfaye/conf.rb', line 32 def self.[] x @@config[x] end |
.config ⇒ Object
16 17 18 |
# File 'lib/rfaye/conf.rb', line 16 def self.config @@config end |
.load(filename, environment) ⇒ Object
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_prefix ⇒ Object
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 |
.version ⇒ Object
20 21 22 |
# File 'lib/rfaye/conf.rb', line 20 def self.version @@version end |