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.


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

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

Instance Method Details

#[](key) ⇒ Object


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

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

#fetch(key) ⇒ Object


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

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