Class: OodCore::BatchConnect::Template
- Inherits:
-
Object
- Object
- OodCore::BatchConnect::Template
- Defined in:
- lib/ood_core/batch_connect/template.rb
Overview
A template class that renders a batch script designed to facilitate external connections to the running job
Direct Known Subclasses
OodCore::BatchConnect::Templates::Basic, OodCore::BatchConnect::Templates::VNC, OodCore::BatchConnect::Templates::VNC_Container
Instance Attribute Summary collapse
-
#context ⇒ Hash
readonly
The context used to render this template.
Instance Method Summary collapse
-
#initialize(context = {}) ⇒ Template
constructor
A new instance of Template.
-
#to_s ⇒ String
Render this template as string.
Constructor Details
#initialize(context = {}) ⇒ Template
Returns a new instance of Template.
56 57 58 59 |
# File 'lib/ood_core/batch_connect/template.rb', line 56 def initialize(context = {}) @context = context.to_h.compact.symbolize_keys raise ArgumentError, "No work_dir specified. Missing argument: work_dir" unless context.include?(:work_dir) end |
Instance Attribute Details
#context ⇒ Hash (readonly)
The context used to render this template
13 14 15 |
# File 'lib/ood_core/batch_connect/template.rb', line 13 def context @context end |
Instance Method Details
#to_s ⇒ String
Render this template as string
63 64 65 66 67 68 69 |
# File 'lib/ood_core/batch_connect/template.rb', line 63 def to_s <<-EOT.gsub(/^ {10}/, '') #{header} #{script_wrapper} #{} EOT end |