Class: ClusterListService

Inherits:
Object
  • Object
show all
Defined in:
lib/uffizzi/services/cluster/list_service.rb

Class Method Summary collapse

Class Method Details

.render_plain_clusters(clusters) ⇒ Object

REFACTOR_ME: Uffizzi.ui.output_format = Uffizzi::UI::Shell::PRETTY_LIST Uffizzi.ui.say(data)



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/uffizzi/services/cluster/list_service.rb', line 8

def render_plain_clusters(clusters)
  clusters.map do |cluster|
    project_name = cluster.dig(:project, :name)

    if project_name.present?
      "- Cluster name: #{cluster[:name].strip} Project name: #{project_name.strip}"
    else
      "- #{cluster[:name]}"
    end
  end.join("\n")
end