Hi,

Does someone can help me to refactor this piece of code :

  18   def view_score
  19     @board = Scoreboard.new
  20     show(msg: '- The Best 3 SCORE -')
  21     rows = []
  22     rows << ['Name', 'Attempts', 'Time!']
  23     rows << :separator
  24     @board.stats.each { |s| rows << [s[:name], s[:tries], s[:time]] 
} unless     @board.stats.nil?
  25     table = Terminal::Table.new rows: rows
  26     table.align_column(1, :center)
  27     table.align_column(2, :center)
  28     puts "#{table}\n\n"
  29   end

Thank you very much for your replies.

Regards,

/Nathan

Unsubscribe: <mailto:ruby-talk-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>