Class: CobraCommander::Output::FlatList
- Inherits:
-
Object
- Object
- CobraCommander::Output::FlatList
- Defined in:
- lib/cobra_commander/output/flat_list.rb
Overview
Prints a list of components’ names sorted alphabetically
Instance Method Summary collapse
-
#initialize(components) ⇒ FlatList
constructor
A new instance of FlatList.
- #to_s ⇒ Object
Constructor Details
#initialize(components) ⇒ FlatList
Returns a new instance of FlatList.
7 8 9 |
# File 'lib/cobra_commander/output/flat_list.rb', line 7 def initialize(components) @components = components end |
Instance Method Details
#to_s ⇒ Object
11 12 13 |
# File 'lib/cobra_commander/output/flat_list.rb', line 11 def to_s @components.map(&:name).sort end |