Class: Hasta::Env
- Inherits:
-
Object
- Object
- Hasta::Env
- Defined in:
- lib/hasta/env.rb
Overview
Constructs the ENV variables required to run a local EMR job
Instance Attribute Summary collapse
-
#files ⇒ Object
readonly
Returns the value of attribute files.
-
#variables ⇒ Object
readonly
Returns the value of attribute variables.
Instance Method Summary collapse
-
#initialize(variables = {}, files = {}, combined_storage = Hasta.combined_storage) ⇒ Env
constructor
A new instance of Env.
- #setup ⇒ Object
Constructor Details
#initialize(variables = {}, files = {}, combined_storage = Hasta.combined_storage) ⇒ Env
Returns a new instance of Env.
11 12 13 14 15 16 17 18 19 |
# File 'lib/hasta/env.rb', line 11 def initialize( variables = {}, files = {}, combined_storage = Hasta.combined_storage ) @variables = variables @files = files @combined_storage = combined_storage end |
Instance Attribute Details
#files ⇒ Object (readonly)
Returns the value of attribute files.
9 10 11 |
# File 'lib/hasta/env.rb', line 9 def files @files end |
#variables ⇒ Object (readonly)
Returns the value of attribute variables.
9 10 11 |
# File 'lib/hasta/env.rb', line 9 def variables @variables end |
Instance Method Details
#setup ⇒ Object
21 22 23 24 25 26 27 28 29 |
# File 'lib/hasta/env.rb', line 21 def setup file_vars = {} files.each do |key, s3_uri| input_source = S3DataSource.new(s3_uri, combined_storage) file_vars[key] = LocalFilePath.for(combined_storage.write(s3_uri, input_source)) end variables.merge(file_vars) end |