Class: CemAcpt::Platform::Base

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

Direct Known Subclasses

TestBase

Constant Summary

Constants included from Logging

Logging::LEVEL_MAP

Instance Method Summary collapse

Methods included from Logging

current_log_config, #current_log_config, current_log_format, #current_log_format, #current_log_level, current_log_level, included, #logger, logger, new_log_config, #new_log_config, new_log_formatter, #new_log_formatter, #new_log_level, new_log_level, #new_logger, new_logger, verbose?, #verbose?

Constructor Details

#initialize(config, **run_data) ⇒ Base

Returns a new instance of Base.



12
13
14
15
# File 'lib/cem_acpt/platform/base.rb', line 12

def initialize(config, **run_data)
  @config = config
  @run_data = run_data
end

Instance Method Details

#image_nameObject



21
22
23
# File 'lib/cem_acpt/platform/base.rb', line 21

def image_name
  @image_name ||= @run_data[:image_name]
end

#node_dataObject

Data specific to the current node.

Raises:

  • (NotImplementedError)


39
40
41
# File 'lib/cem_acpt/platform/base.rb', line 39

def node_data
  raise NotImplementedError, 'node_data must be implemented by the specific platform module'
end

#node_nameObject



17
18
19
# File 'lib/cem_acpt/platform/base.rb', line 17

def node_name
  @node_name ||= random_node_name
end

#platform_dataObject

Data common to all nodes of the same platform.

Raises:

  • (NotImplementedError)


34
35
36
# File 'lib/cem_acpt/platform/base.rb', line 34

def platform_data
  raise NotImplementedError, 'platform_data must be implemented by the specific platform module'
end

#to_hObject



25
26
27
# File 'lib/cem_acpt/platform/base.rb', line 25

def to_h
  { node_name: node_name, platform_data: platform_data, node_data: node_data }
end

#to_json(*args) ⇒ Object



29
30
31
# File 'lib/cem_acpt/platform/base.rb', line 29

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