Class: Hiera::Backend::Eyaml::Options

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

Class Method Summary collapse

Class Method Details

.[](key) ⇒ Object



10
11
12
13
# File 'lib/hiera/backend/eyaml/options.rb', line 10

def self.[](key)
  @@options ||= {}
  @@options[key.to_sym]
end

.[]=(key, value) ⇒ Object



5
6
7
8
# File 'lib/hiera/backend/eyaml/options.rb', line 5

def self.[]=(key, value)
  @@options ||= {}
  @@options[key.to_sym] = value
end

.set(hash) ⇒ Object



15
16
17
18
19
20
# File 'lib/hiera/backend/eyaml/options.rb', line 15

def self.set(hash)
  @@options = {}
  hash.each do |k, v|
    @@options[k.to_sym] = v
  end
end

.traceObject



22
23
24
25
26
27
28
29
30
31
32
# File 'lib/hiera/backend/eyaml/options.rb', line 22

def self.trace
  LoggingHelper.trace 'Dump of eyaml tool options dict:'
  LoggingHelper.trace '--------------------------------'
  @@options.each do |k, v|
    LoggingHelper.trace format '%18s %-18s = %18s %-18s', "(#{k.class.name})", k.to_s, "(#{v.class.name})",
                               v.to_s
  rescue StandardError
    LoggingHelper.trace format '%18s %-18s = %18s %-18s', "(#{k.class.name})", k.to_s, "(#{v.class.name})", '<unprintable>' # case where v is binary
  end
  LoggingHelper.trace '--------------------------------'
end