class SwitchDb::Command::List

Public Instance Methods

run(*) click to toggle source
# File lib/switch_db/command/list.rb, line 4
def run(*)
  length = @reference_set.references.size.to_s.length

  @reference_set.references.each_with_index do |(_, reference), index|
    puts "#{format_index(length, index)}: #{reference.name}"
  end
end

Private Instance Methods

format_index(length, index) click to toggle source
# File lib/switch_db/command/list.rb, line 14
def format_index(length, index)
  format("%#{length}d", index)
end