fetch

ENV.fetch(name) â value
ENV.fetch(name, default) â value
ENV.fetch(name) { |missing_name| ... } â value
Class Public methods

Retrieves the environment variable name.

If the given name does not exist and neither default nor a block a provided an IndexError is raised. If a block is given it is called with the missing name to provide a value. If a default value is given it will be returned when no block is given.

doc_ruby_on_rails
2015-04-05 06:47:24
Comments
Leave a Comment

Please login to continue.