Class: Funnel::Configuration
- Inherits:
-
Object
- Object
- Funnel::Configuration
- Defined in:
- lib/funnel/configuration.rb
Constant Summary collapse
- @@map =
{ :host => "0.0.0.0", :port => 4000, :accepted_origins => [] }
Class Method Summary collapse
Class Method Details
.get(key) ⇒ Object
11 12 13 |
# File 'lib/funnel/configuration.rb', line 11 def self.get key @@map[key.to_sym] end |
.load(file) ⇒ Object
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/funnel/configuration.rb', line 19 def self.load file begin settings = YAML.load_file(File.join(FUNNEL_ROOT, file)) settings.each do |key, val| put key, val end rescue raise IOError, "#{File.join(FUNNEL_ROOT, file)} could not be loaded." end end |
.put(key, val) ⇒ Object
15 16 17 |
# File 'lib/funnel/configuration.rb', line 15 def self.put key, val @@map[key.to_sym] = val end |