Class: Snapback::ConfigurationLoader
- Inherits:
-
Object
- Object
- Snapback::ConfigurationLoader
- Defined in:
- lib/snapback/configuration_loader.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ ConfigurationLoader
constructor
:nodoc:.
Constructor Details
#initialize(options = {}) ⇒ ConfigurationLoader
:nodoc:
5 6 |
# File 'lib/snapback/configuration_loader.rb', line 5 def initialize(={}) #:nodoc: end |
Class Method Details
.factory(filename) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/snapback/configuration_loader.rb', line 8 def self.factory filename begin # Read confirmation options configuration = YAML.load_file filename rescue raise "Could not load configuration file: #{filename}" end case configuration['version'] when "0.0.3" ::Snapback::Configuration::Configuration_0_0_3.new configuration else raise "Unknown configuration version: #{configuration['version']}" end end |