Class: CemAcpt::Platform::Base
- Inherits:
-
Object
- Object
- CemAcpt::Platform::Base
- Includes:
- Logging
- Defined in:
- lib/cem_acpt/platform/base.rb
Direct Known Subclasses
Constant Summary
Constants included from Logging
Instance Method Summary collapse
- #image_name ⇒ Object
-
#initialize(config, **run_data) ⇒ Base
constructor
A new instance of Base.
-
#node_data ⇒ Object
Data specific to the current node.
- #node_name ⇒ Object
-
#platform_data ⇒ Object
Data common to all nodes of the same platform.
- #to_h ⇒ Object
- #to_json(*args) ⇒ Object
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_name ⇒ Object
21 22 23 |
# File 'lib/cem_acpt/platform/base.rb', line 21 def image_name @image_name ||= @run_data[:image_name] end |
#node_data ⇒ Object
Data specific to the current node.
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_name ⇒ Object
17 18 19 |
# File 'lib/cem_acpt/platform/base.rb', line 17 def node_name @node_name ||= random_node_name end |
#platform_data ⇒ Object
Data common to all nodes of the same platform.
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_h ⇒ Object
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 |