instance method require

Ruby on Rails edge

Since edge

Signature

require(*key)

Find an upcased and double-underscored-joined string-version of the key in ENV. Raises KeyError if not found.

Given ENV:

“‘ DB_HOST: “env.example.com” DATABASE__HOST: “env.example.com” “`

Examples:

“‘ require(:db_host) # => “env.example.com” require(:database, :host) # => “env.example.com” require(:missing) # => KeyError “`

Parameters

key rest
Source
# File activesupport/lib/active_support/env_configuration.rb, line 41
    def require(*key)
      @envs.fetch envify(*key)
    end

Defined in activesupport/lib/active_support/env_configuration.rb line 41 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveSupport::EnvConfiguration

Type at least 2 characters to search.

Use the arrow keys to navigate results, Enter to open one, Escape to close.

Keyboard shortcuts

/
Focus search
⌘K / Ctrl-K
Command palette
?
This help
Esc
Close