Class: Hiera::Backend::Env_backend

Inherits:
Object
  • Object
show all
Defined in:
lib/hiera/backend/env_backend.rb

Overview

rubocop:disable Naming/ClassAndModuleCamelCase

Instance Method Summary collapse

Constructor Details

#initializeEnv_backend

Returns a new instance of Env_backend.



9
10
11
# File 'lib/hiera/backend/env_backend.rb', line 9

def initialize
  Hiera.debug('Hiera environment backend starting')
end

Instance Method Details

#lookup(key, scope, _order_override, resolution_type, _context) ⇒ Object



13
14
15
16
17
18
19
20
21
22
# File 'lib/hiera/backend/env_backend.rb', line 13

def lookup(key, scope, _order_override, resolution_type, _context)
  Hiera.debug(
    "Looking up #{key} in environment backend with #{resolution_type}"
  )

  Backend.parse_answer(
    ENV[key.to_s.upcase] || throw(:no_such_key),
    scope
  )
end