Class: RailsEnvCredentials::Config
- Inherits:
-
Object
- Object
- RailsEnvCredentials::Config
- Defined in:
- lib/rails_env_credentials/config.rb
Instance Attribute Summary collapse
-
#env ⇒ Object
readonly
Returns the value of attribute env.
Instance Method Summary collapse
-
#initialize(env: nil, config_path: nil) ⇒ Config
constructor
A new instance of Config.
- #to_options ⇒ Object
Constructor Details
#initialize(env: nil, config_path: nil) ⇒ Config
Returns a new instance of Config.
7 8 9 10 |
# File 'lib/rails_env_credentials/config.rb', line 7 def initialize(env: nil, config_path: nil) @env = env.nil? ? Rails.env : ActiveSupport::StringInquirer.new(env) @config_path = config_path end |
Instance Attribute Details
#env ⇒ Object (readonly)
Returns the value of attribute env.
5 6 7 |
# File 'lib/rails_env_credentials/config.rb', line 5 def env @env end |
Instance Method Details
#to_options ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/rails_env_credentials/config.rb', line 12 def env_key = env_suffix("RAILS_MASTER_KEY", "_").upcase key_path = "config/#{env_suffix("master")}.key" { config_path: config_path, env_key: env_key, key_path: key_path, raise_if_missing_key: false } end |