Class: Snapback::ConfigurationLoader

Inherits:
Object
  • Object
show all
Defined in:
lib/snapback/configuration_loader.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ ConfigurationLoader

:nodoc:



5
6
# File 'lib/snapback/configuration_loader.rb', line 5

def initialize(options={}) #: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