Sha256: 8fd829db7672d5720f39b665b500a74250d2492736af93b991f380b9e96da53d

Contents?: true

Size: 505 Bytes

Versions: 8

Compression:

Stored size: 505 Bytes

Contents

module ComplexConfig
  class Proxy < BasicObject
    def initialize(env = nil)
      @env = env
    end

    def to_s
      'ComplexConfig::Proxy'
    end

    def inspect
      "#<#{to_s}>"
    end

    def reload
      ::ComplexConfig::Provider.flush_cache
      self
    end

    def method_missing(name, *args)
      config = ::ComplexConfig::Provider[name]
      env, = args
      if env
        config[env]
      elsif @env
        config[@env]
      else
        config
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
complex_config-0.9.1 lib/complex_config/proxy.rb
complex_config-0.9.0 lib/complex_config/proxy.rb
complex_config-0.8.0 lib/complex_config/proxy.rb
complex_config-0.7.0 lib/complex_config/proxy.rb
complex_config-0.6.0 lib/complex_config/proxy.rb
complex_config-0.5.2 lib/complex_config/proxy.rb
complex_config-0.5.0 lib/complex_config/proxy.rb
complex_config-0.4.0 lib/complex_config/proxy.rb