class Kontena::Cli::Master::ListCommand
Public Instance Methods
current_master_name()
click to toggle source
# File lib/kontena/cli/master/list_command.rb, line 10 def current_master_name @current_master_name ||= current_master.nil? ? nil : current_master.name end
execute()
click to toggle source
# File lib/kontena/cli/master/list_command.rb, line 20 def execute print_table(config.servers, fields, &method(:mark_if_current)) end
fields()
click to toggle source
# File lib/kontena/cli/master/list_command.rb, line 6 def fields @fields ||= quiet? ? %w(name) : %w(name url) end
mark_if_current(row)
click to toggle source
# File lib/kontena/cli/master/list_command.rb, line 14 def mark_if_current(row) unless quiet? row.name.to_s.insert(0, pastel.yellow('* ')) if row.name == current_master_name end end