Class: OTB::Queue
- Inherits:
-
Object
- Object
- OTB::Queue
- Defined in:
- lib/OTB/queue.rb
Instance Attribute Summary collapse
-
#jobs ⇒ Object
Returns the value of attribute jobs.
-
#jobs_parsed ⇒ Object
Returns the value of attribute jobs_parsed.
Instance Method Summary collapse
-
#initialize(string: nil) ⇒ Queue
constructor
Idea being you could also have string:nil then you could initialized with Job objects in the jobs: or you could initialized with String objects in the string:.
- #sort_sequence ⇒ Object
Constructor Details
#initialize(string: nil) ⇒ Queue
Idea being you could also have string:nil then you could initialized with Job objects in the jobs: or you could initialized with String objects in the string:
9 10 11 12 |
# File 'lib/OTB/queue.rb', line 9 def initialize(string:nil) @jobs = string @jobs_parsed = OTB::Job.parse(@jobs) unless string.nil? end |
Instance Attribute Details
#jobs ⇒ Object
Returns the value of attribute jobs.
3 4 5 |
# File 'lib/OTB/queue.rb', line 3 def jobs @jobs end |
#jobs_parsed ⇒ Object
Returns the value of attribute jobs_parsed.
3 4 5 |
# File 'lib/OTB/queue.rb', line 3 def jobs_parsed @jobs_parsed end |
Instance Method Details
#sort_sequence ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/OTB/queue.rb', line 14 def sort_sequence case @jobs when '' '' when nil raise JobQueueError.no_input_error else check_self_dependency(@jobs_parsed) check_circular_dependency(@jobs_parsed) sort_jobs_to_sequence(@jobs_parsed) end end |