Bits 8
Using ENV.fetch("MY_ENV_VAR", default_value) is preferred over ENV["MY_ENV_VAR"] for specifying default values. While it is similar to ENV["MY_ENV_VAR"] || default_value, fetch is more explicit and idiomatic in Ruby.
Press ← or → to navigate between chapters
Press S or / to search in the book
Press ? to show this help
Press Esc to hide this help
Using ENV.fetch("MY_ENV_VAR", default_value) is preferred over ENV["MY_ENV_VAR"] for specifying default values. While it is similar to ENV["MY_ENV_VAR"] || default_value, fetch is more explicit and idiomatic in Ruby.