Class: AzkabanScheduler::Project
- Inherits:
-
Object
- Object
- AzkabanScheduler::Project
- Defined in:
- lib/azkaban_scheduler/project.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the value of attribute description.
-
#id ⇒ Object
Returns the value of attribute id.
-
#jobs ⇒ Object
Returns the value of attribute jobs.
-
#name ⇒ Object
Returns the value of attribute name.
-
#version ⇒ Object
Returns the value of attribute version.
Instance Method Summary collapse
- #add_job(name, job) ⇒ Object
- #build ⇒ Object
-
#initialize(name, description) ⇒ Project
constructor
A new instance of Project.
- #write(io) ⇒ Object
Constructor Details
#initialize(name, description) ⇒ Project
9 10 11 12 13 |
# File 'lib/azkaban_scheduler/project.rb', line 9 def initialize(name, description) @name = name @description = description @jobs = {} end |
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description.
6 7 8 |
# File 'lib/azkaban_scheduler/project.rb', line 6 def description @description end |
#id ⇒ Object
Returns the value of attribute id.
7 8 9 |
# File 'lib/azkaban_scheduler/project.rb', line 7 def id @id end |
#jobs ⇒ Object
Returns the value of attribute jobs.
6 7 8 |
# File 'lib/azkaban_scheduler/project.rb', line 6 def jobs @jobs end |
#name ⇒ Object
Returns the value of attribute name.
6 7 8 |
# File 'lib/azkaban_scheduler/project.rb', line 6 def name @name end |
#version ⇒ Object
Returns the value of attribute version.
7 8 9 |
# File 'lib/azkaban_scheduler/project.rb', line 7 def version @version end |
Instance Method Details
#add_job(name, job) ⇒ Object
15 16 17 |
# File 'lib/azkaban_scheduler/project.rb', line 15 def add_job(name, job) @jobs[name] = job end |
#build ⇒ Object
19 20 21 22 23 24 |
# File 'lib/azkaban_scheduler/project.rb', line 19 def build io = StringIO.new write(io) io.rewind io end |
#write(io) ⇒ Object
26 27 28 29 30 31 32 33 |
# File 'lib/azkaban_scheduler/project.rb', line 26 def write(io) Zip::OutputStream.write_buffer(io) do |out| @jobs.each do |name, job| out.put_next_entry("#{name}.job") job.write(out) end end end |