Class: Semaph::Shells::Pipeline::JobsListCommand
- Inherits:
-
Object
- Object
- Semaph::Shells::Pipeline::JobsListCommand
- Defined in:
- lib/semaph/shells/pipeline/jobs_list_command.rb
Instance Attribute Summary collapse
-
#help ⇒ Object
readonly
Returns the value of attribute help.
-
#usage ⇒ Object
readonly
Returns the value of attribute usage.
Instance Method Summary collapse
- #execute(_whatever = nil) ⇒ Object
-
#initialize(job_collection) ⇒ JobsListCommand
constructor
A new instance of JobsListCommand.
Constructor Details
#initialize(job_collection) ⇒ JobsListCommand
Returns a new instance of JobsListCommand.
9 10 11 12 |
# File 'lib/semaph/shells/pipeline/jobs_list_command.rb', line 9 def initialize(job_collection) @job_collection = job_collection @help = "list jobs" end |
Instance Attribute Details
#help ⇒ Object (readonly)
Returns the value of attribute help.
7 8 9 |
# File 'lib/semaph/shells/pipeline/jobs_list_command.rb', line 7 def help @help end |
#usage ⇒ Object (readonly)
Returns the value of attribute usage.
7 8 9 |
# File 'lib/semaph/shells/pipeline/jobs_list_command.rb', line 7 def usage @usage end |
Instance Method Details
#execute(_whatever = nil) ⇒ Object
14 15 16 17 18 19 |
# File 'lib/semaph/shells/pipeline/jobs_list_command.rb', line 14 def execute(_whatever = nil) @job_collection.reload @job_collection.all.each_with_index do |job, index| puts [::Semaph::Formatting.index(index + 1), job.description].join(" ") end end |