Class: BlueprintConfig::Backend::Credentials

Inherits:
Base
  • Object
show all
Defined in:
lib/blueprint_config/backend/credentials.rb

Instance Method Summary collapse

Methods inherited from Base

#fresh?, #nest_hash, #source

Instance Method Details

#credentialsObject



12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/blueprint_config/backend/credentials.rb', line 12

def credentials
  if defined?(Rails)
    Rails.application.credentials
  else
    ActiveSupport::EncryptedConfiguration.new(
      config_path: 'config/credentials.yml.enc',
      key_path: 'config/master.key',
      env_key: 'RAILS_MASTER_KEY',
      raise_if_missing_key: false
    )
  end
end

#load_keysObject



8
9
10
# File 'lib/blueprint_config/backend/credentials.rb', line 8

def load_keys
  credentials.to_h
end