Class: HieraFiver

Inherits:
Object
  • Object
show all
Defined in:
lib/puppet/HieraFiver.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(yaml_text) ⇒ HieraFiver

Returns a new instance of HieraFiver.



12
13
14
15
16
17
18
19
20
# File 'lib/puppet/HieraFiver.rb', line 12

def initialize(yaml_text)
  @backends_data_hash  = ['yaml', 'json', 'hocon']
  @backends_lookup_key = ['eyaml']
  @backends_data_dig   = []

  @config5 = { 'version' => 5, 'hierarchy' => [], }
  @config3 = YAML.load(yaml_text)
  parse_config3
end

Instance Attribute Details

#backends_data_digObject

Use accessors in order to specify more backends under each category



23
24
25
# File 'lib/puppet/HieraFiver.rb', line 23

def backends_data_dig
  @backends_data_dig
end

#backends_data_hashObject

Use accessors in order to specify more backends under each category



23
24
25
# File 'lib/puppet/HieraFiver.rb', line 23

def backends_data_hash
  @backends_data_hash
end

#backends_lookup_keyObject

Use accessors in order to specify more backends under each category



23
24
25
# File 'lib/puppet/HieraFiver.rb', line 23

def backends_lookup_key
  @backends_lookup_key
end

Instance Method Details

#to_5Object



25
26
27
# File 'lib/puppet/HieraFiver.rb', line 25

def to_5
  fix_quotes(@config5.to_yaml)
end