Class: Semaph::Shells::Workflow::PipelinesListCommand

Inherits:
Object
  • Object
show all
Defined in:
lib/semaph/shells/workflow/pipelines_list_command.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(pipeline_collection) ⇒ PipelinesListCommand

Returns a new instance of PipelinesListCommand.



9
10
11
12
# File 'lib/semaph/shells/workflow/pipelines_list_command.rb', line 9

def initialize(pipeline_collection)
  @pipeline_collection = pipeline_collection
  @help = "list pipelines"
end

Instance Attribute Details

#helpObject (readonly)

Returns the value of attribute help.



7
8
9
# File 'lib/semaph/shells/workflow/pipelines_list_command.rb', line 7

def help
  @help
end

#usageObject (readonly)

Returns the value of attribute usage.



7
8
9
# File 'lib/semaph/shells/workflow/pipelines_list_command.rb', line 7

def usage
  @usage
end

Instance Method Details

#execute(_whatever) ⇒ Object



14
15
16
17
18
19
# File 'lib/semaph/shells/workflow/pipelines_list_command.rb', line 14

def execute(_whatever)
  @pipeline_collection.reload
  @pipeline_collection.all.each_with_index do |pipeline, index|
    puts [::Semaph::Formatting.index(index + 1), pipeline.description].join(" ")
  end
end