Class: Minfra::Cli::Env

Inherits:
Object
  • Object
show all
Defined in:
lib/minfra/cli/env.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, hiera_root:, hiera_env_path:, hiera_debug_lookups:, backends:) ⇒ Env

Returns a new instance of Env.



5
6
7
8
9
10
11
12
13
14
# File 'lib/minfra/cli/env.rb', line 5

def initialize(name:, hiera_root:,   hiera_env_path:, hiera_debug_lookups:, backends: )
  @name = name            
  @hiera = HieraLooker.new( 
    root: hiera_root,
    env_name: name,
    env_path: hiera_env_path,
    debug_lookups: hiera_debug_lookups,
    backends: backends
  )
end

Instance Attribute Details

#hieraObject (readonly)

Returns the value of attribute hiera.



4
5
6
# File 'lib/minfra/cli/env.rb', line 4

def hiera
  @hiera
end

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/minfra/cli/env.rb', line 4

def name
  @name
end

Instance Method Details

#l(key, value = nil) ⇒ Object



16
17
18
# File 'lib/minfra/cli/env.rb', line 16

def l(key, value = nil)
  @hiera.l(key,value)
end

#l!(key, value = nil) ⇒ Object



20
21
22
# File 'lib/minfra/cli/env.rb', line 20

def l!(key, value = nil)
  @hiera.l!(key, value)
end