Class: ContainedMr::Mock::Template
- Inherits:
-
Object
- Object
- ContainedMr::Mock::Template
- Includes:
- TemplateLogic
- Defined in:
- lib/contained_mr/mock/template.rb
Overview
Instance Attribute Summary collapse
-
#_definition ⇒ Hash<String, Object>
readonly
YAML-parsed mapreduced.yml.
-
#_zip_contents ⇒ Hash<String, Symbol|String>
readonly
Maps file names in the template .zip to their contents, and maps directory entries to the :directory symbol.
Attributes included from TemplateLogic
#id, #image_id, #item_count, #name_prefix
Instance Method Summary collapse
- #destroy! ⇒ Object
-
#destroyed? ⇒ Boolean
True if #destroy! was called.
-
#initialize(name_prefix, id, zip_io) ⇒ Template
constructor
A new instance of Template.
- #job_class ⇒ Object
Methods included from TemplateLogic
#image_tag, #mapper_dockerfile, #mapper_env, #mapper_output_path, #new_job, #reducer_dockerfile, #reducer_env, #reducer_output_path
Constructor Details
#initialize(name_prefix, id, zip_io) ⇒ Template
Returns a new instance of Template.
18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/contained_mr/mock/template.rb', line 18 def initialize(name_prefix, id, zip_io) @name_prefix = name_prefix @id = id @image_id = 'mock-template-image-id' @item_count = nil @_definition = nil @destroyed = false @_zip_contents = {} process_zip zip_io end |
Instance Attribute Details
#_definition ⇒ Hash<String, Object> (readonly)
Returns YAML-parsed mapreduced.yml.
4 5 6 |
# File 'lib/contained_mr/mock/template.rb', line 4 def _definition @_definition end |
#_zip_contents ⇒ Hash<String, Symbol|String> (readonly)
Returns maps file names in the template .zip to their contents, and maps directory entries to the :directory symbol.
8 9 10 |
# File 'lib/contained_mr/mock/template.rb', line 8 def _zip_contents @_zip_contents end |
Instance Method Details
#destroy! ⇒ Object
32 33 34 35 |
# File 'lib/contained_mr/mock/template.rb', line 32 def destroy! @destroyed = true self end |
#destroyed? ⇒ Boolean
Returns true if #destroy! was called.
13 14 15 |
# File 'lib/contained_mr/mock/template.rb', line 13 def destroyed? @destroyed end |
#job_class ⇒ Object
38 39 40 |
# File 'lib/contained_mr/mock/template.rb', line 38 def job_class ContainedMr::Mock::Job end |