Open
Description
Auto-approvable:
class HighScores
def initialize(scores)
@scores = scores
end
def scores
@scores
end
def personal_best
scores.max
end
def latest
scores.last
end
def personal_top_three
scores.max(3)
end
end
Approvable variants:
-
Use
attr_reader
(but not attr_accessor) instead of thescores
getter method. -
In
personal_top_three
, the following variants can be approved immediately, but with a comment to look intomax(3)
:scores.sort.reverse.first(3)
,scores.sort.reverse.take(3)
All other variants are not eligible for auto-approval. Including a different order of the methods.
Metadata
Assignees
Labels
No labels