Method: Gin::Config#initialize

Defined in:
lib/gin/config.rb

#initialize(environment, opts = {}) ⇒ Config

Create a new config instance for the given environment name. The environment dictates which part of the config files gets exposed.



50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/gin/config.rb', line 50

def initialize environment, opts={}
  @environment = environment
  @logger      = opts[:logger] || Logger.new($stdout)
  @ttl         = opts[:ttl]    || false
  @dir         = opts[:dir]    || "./config"

  @data       = {}
  @load_times = {}
  @mtimes     = {}

  @lock = Gin::RWLock.new(opts[:write_timeout])
end