Class: Nomade::Job
- Inherits:
-
Object
- Object
- Nomade::Job
- Defined in:
- lib/nomade/job.rb
Instance Method Summary collapse
- #configuration(format) ⇒ Object
- #image_name ⇒ Object
- #image_name_and_version ⇒ Object
- #image_version ⇒ Object
-
#initialize(image_full_name, config_hcl, config_json, config_hash) ⇒ Job
constructor
A new instance of Job.
- #job_name ⇒ Object
- #job_type ⇒ Object
Constructor Details
#initialize(image_full_name, config_hcl, config_json, config_hash) ⇒ Job
Returns a new instance of Job.
3 4 5 6 7 8 |
# File 'lib/nomade/job.rb', line 3 def initialize(image_full_name, config_hcl, config_json, config_hash) @image_full_name = image_full_name @config_hcl = config_hcl @config_json = config_json @config_hash = config_hash end |
Instance Method Details
#configuration(format) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/nomade/job.rb', line 10 def configuration(format) case format when :hcl @config_hcl when :json @config_json when :hash @config_hash else @config_hash end end |
#image_name ⇒ Object
35 36 37 |
# File 'lib/nomade/job.rb', line 35 def image_name image_name_and_version.split(":").first end |
#image_name_and_version ⇒ Object
31 32 33 |
# File 'lib/nomade/job.rb', line 31 def image_name_and_version @image_full_name end |
#image_version ⇒ Object
39 40 41 |
# File 'lib/nomade/job.rb', line 39 def image_version image_name_and_version.split(":").last end |
#job_name ⇒ Object
23 24 25 |
# File 'lib/nomade/job.rb', line 23 def job_name @config_hash["ID"] end |
#job_type ⇒ Object
27 28 29 |
# File 'lib/nomade/job.rb', line 27 def job_type @config_hash["Type"] end |