Class: CodeReviewLeaderboard::Formatter
- Inherits:
-
Object
- Object
- CodeReviewLeaderboard::Formatter
- Defined in:
- lib/code_review_leaderboard/formatter.rb
Instance Method Summary collapse
-
#initialize(tally) ⇒ Formatter
constructor
A new instance of Formatter.
- #to_table ⇒ Object
Constructor Details
#initialize(tally) ⇒ Formatter
Returns a new instance of Formatter.
5 6 7 |
# File 'lib/code_review_leaderboard/formatter.rb', line 5 def initialize(tally) @tally = tally end |
Instance Method Details
#to_table ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/code_review_leaderboard/formatter.rb', line 9 def to_table Terminal::Table.new(headings:) do |rows| totals.each do |user, reviews| rows << [user, reviews[:total], reviews[:approved], reviews[:changes_requested], reviews[:commented]] end end end |