Class: CemAcpt::NodeData

Inherits:
Object
  • Object
show all
Includes:
Logging
Defined in:
lib/cem_acpt/shared_objects.rb

Overview

Provides an object to hold NodeData configs. Not thread-safe. Should not be mutated by itself, but can be mutated safely by the NodeInventory object. Currently unused.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Logging

current_log_config, #current_log_config, current_log_format, current_log_level, #current_log_level, included, #logger, new_log_config, #new_log_config, new_log_formatter, new_log_level, #new_log_level

Constructor Details

#initialize(name, data) ⇒ NodeData

Returns a new instance of NodeData.



127
128
129
130
131
# File 'lib/cem_acpt/shared_objects.rb', line 127

def initialize(name, data)
  data.format!
  @name = name
  @opts = data
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



125
126
127
# File 'lib/cem_acpt/shared_objects.rb', line 125

def data
  @data
end

#nameObject (readonly)

Returns the value of attribute name.



125
126
127
# File 'lib/cem_acpt/shared_objects.rb', line 125

def name
  @name
end

Instance Method Details

#deep_merge(other) ⇒ Object



133
134
135
# File 'lib/cem_acpt/shared_objects.rb', line 133

def deep_merge(other)
  @opts.deep_merge(other.to_h)
end

#dot_dig(dot_key) ⇒ Object



137
138
139
# File 'lib/cem_acpt/shared_objects.rb', line 137

def dot_dig(dot_key)
  @opts.dot_dig(dot_key)
end

#dot_store(dot_key, value) ⇒ Object



141
142
143
# File 'lib/cem_acpt/shared_objects.rb', line 141

def dot_store(dot_key, value)
  @opts.dot_store(dot_key, value)
end

#to_hObject



145
146
147
# File 'lib/cem_acpt/shared_objects.rb', line 145

def to_h
  @opts
end

#to_json(*args) ⇒ Object



153
154
155
# File 'lib/cem_acpt/shared_objects.rb', line 153

def to_json(*args)
  to_h.to_json(*args)
end

#to_yamlObject



149
150
151
# File 'lib/cem_acpt/shared_objects.rb', line 149

def to_yaml
  to_h.to_yaml
end