Class: Semaph::Shells::Pipeline::PromotionsListCommand
- Inherits:
-
Object
- Object
- Semaph::Shells::Pipeline::PromotionsListCommand
- Defined in:
- lib/semaph/shells/pipeline/promotions_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) ⇒ Object
-
#initialize(promotion_collection) ⇒ PromotionsListCommand
constructor
A new instance of PromotionsListCommand.
Constructor Details
#initialize(promotion_collection) ⇒ PromotionsListCommand
Returns a new instance of PromotionsListCommand.
7 8 9 10 |
# File 'lib/semaph/shells/pipeline/promotions_list_command.rb', line 7 def initialize(promotion_collection) @promotion_collection = promotion_collection @help = "list promotions" end |
Instance Attribute Details
#help ⇒ Object (readonly)
Returns the value of attribute help.
5 6 7 |
# File 'lib/semaph/shells/pipeline/promotions_list_command.rb', line 5 def help @help end |
#usage ⇒ Object (readonly)
Returns the value of attribute usage.
5 6 7 |
# File 'lib/semaph/shells/pipeline/promotions_list_command.rb', line 5 def usage @usage end |
Instance Method Details
#execute(_whatever) ⇒ Object
12 13 14 15 16 17 |
# File 'lib/semaph/shells/pipeline/promotions_list_command.rb', line 12 def execute(_whatever) @promotion_collection.reload @promotion_collection.all.each_with_index do |promotion, index| puts "#{index + 1} #{promotion.description}" end end |