Skip to content

Instantly share code, notes, and snippets.

@denisdefreyne
Created May 18, 2022 09:42
Show Gist options
  • Save denisdefreyne/04d90de6c63c38aa7501d1936af59df6 to your computer and use it in GitHub Desktop.
Save denisdefreyne/04d90de6c63c38aa7501d1936af59df6 to your computer and use it in GitHub Desktop.
class Score
attr_reader :value
def initialize(value)
@value = value
end
def grade
if @value < 10
"failing"
elsif @value < 14
"passing"
elsif @value < 16
"distinction"
elsif @value < 18
"high distinction"
else
"highest distinction"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment