Class: Fig::EnvironmentVariables::CaseSensitive

Inherits:
Object
  • Object
show all
Includes:
Fig::EnvironmentVariables
Defined in:
lib/fig/environment_variables/case_sensitive.rb

Overview

Manager of a set of environment variables where the variable names are case-sensitive, e.g. on *nix.

Instance Method Summary collapse

Methods included from Fig::EnvironmentVariables

#empty?, #initialize, #keys, #with_environment

Instance Method Details

#[](key) ⇒ Object



13
14
15
# File 'lib/fig/environment_variables/case_sensitive.rb', line 13

def [](key)
  return @variables[key]
end

#[]=(new_key, new_value) ⇒ Object



17
18
19
20
21
# File 'lib/fig/environment_variables/case_sensitive.rb', line 17

def []=(new_key, new_value)
  @variables[new_key] = new_value

  return
end

#prepend_variable(key, new_value) ⇒ Object



23
24
25
26
27
28
29
30
31
# File 'lib/fig/environment_variables/case_sensitive.rb', line 23

def prepend_variable(key, new_value)
  if @variables.key?(key)
    @variables[key] = new_value + File::PATH_SEPARATOR + @variables[key]
  else
    @variables[key] = new_value
  end

  return
end