Class: PDK::Util::Env::WindowsEnv

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/pdk/util/env.rb

Instance Method Summary collapse

Instance Method Details

#[](key) ⇒ Object



21
22
23
24
25
26
27
28
# File 'lib/pdk/util/env.rb', line 21

def [](key)
  env_hash.each do |item, value|
    next unless key.casecmp(item).zero?

    return value
  end
  nil
end

#[]=(key, value) ⇒ Object



13
14
15
# File 'lib/pdk/util/env.rb', line 13

def []=(key, value)
  PDK::Util::Windows::Process.set_environment_variable(key, value)
end

#key?(key) ⇒ Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/pdk/util/env.rb', line 17

def key?(key)
  !env_hash.keys.find { |item| key.casecmp(item).zero? }.nil?
end