Sha256: 9ce52cb795e3651dbb974f38056f7da90278e8df37cd75e44f3717c757c85e3c

Contents?: true

Size: 446 Bytes

Versions: 5

Compression:

Stored size: 446 Bytes

Contents

module Hanoi
  module Jane
    class Config
      include Singleton

      def initialize
        reset!
      end

      def reset! # testing a singleton is hard
        @config = OpenStruct.new fetch_yaml 'config'
      end

      def config
        @config
      end

      private

      def fetch_yaml file
        YAML.load(File.open(File.join(File.dirname(__FILE__), '..', '..', '..', 'config/%s.yml' % file)))
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
hanoi-jane-0.4.0 lib/hanoi/jane/config.rb
hanoi-jane-0.3.4 lib/hanoi/jane/config.rb
hanoi-jane-0.3.3 lib/hanoi/jane/config.rb
hanoi-jane-0.3.1 lib/hanoi/jane/config.rb
hanoi-jane-0.3.0 lib/hanoi/jane/config.rb