Class: Sprockets::Context::ENVProxy

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/sprockets/context.rb

Overview

Internal: Proxy for ENV that keeps track of the environment variables used

Instance Method Summary collapse

Constructor Details

#initialize(context) ⇒ ENVProxy

Returns a new instance of ENVProxy.



24
25
26
27
# File 'lib/sprockets/context.rb', line 24

def initialize(context)
  @context = context
  super(ENV)
end

Instance Method Details

#[](key) ⇒ Object



29
30
31
32
# File 'lib/sprockets/context.rb', line 29

def [](key)
  @context.depend_on_env(key)
  super
end

#fetch(key) ⇒ Object



34
35
36
37
# File 'lib/sprockets/context.rb', line 34

def fetch(key, *)
  @context.depend_on_env(key)
  super
end