Sha256: 0bdc6c4b539a8f9381df61d2ff33d2ba59a2a01ccaeedc10ce65ec21d1c11719

Contents?: true

Size: 428 Bytes

Versions: 1

Compression:

Stored size: 428 Bytes

Contents

require 'hashie'
require 'singleton'
require 'yaml'

module TCity
  class Configuration
    include Singleton

    attr_reader :config

    def initialize
      @config = Hashie::Mash.new(YAML.load_file self.class.config_file_path)
    end

    private

    def self.method_missing(method, *args)
      instance.config.send method, args
    end

    def self.config_file_path
      "#{ENV['HOME']}/.tcity.yml"
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tcity-0.0.1a lib/tcity/configuration.rb