You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 the scores getter method.
In personal_top_three, the following variants can be approved immediately, but with a comment to look into max(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.
The text was updated successfully, but these errors were encountered:
iHiD
transferred this issue from exercism/automated-analysis
Jul 3, 2019
iHiD
changed the title
Approvables in Ruby: High Scores
Approvable solutions for High Scores
Jul 3, 2019
Auto-approvable:
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.
The text was updated successfully, but these errors were encountered: