Am I right to consider ENV a Hash
ENV['HOME']
=>'/Users/yozloy'
But
ENV.class
#=>Object
It implements most of the Hash methods but apparently a few are missing:
[:default, :default=, :default_proc, :default_proc=, :merge!, :merge, :flatten, :compare_by_identity, :compare_by_identity?]
Most of these you'd never think to use, but merge
and flatten
could be useful.
Remember that ENV
isn't exactly a Hash, but a wrapper around the environment variables and the associated methods for retrieving and setting them.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With