← Back to Upcase

Refactoring - Extract Value Object

(Upcase ) #1

This topic is for the [Extract Value Object][] exercise in the [Refactoring][] trail. Post any questions, corrections, or pointers you have to share with other Upcase subscribers.
[Extract Value Object]: https://exercises.upcase.com/exercises/extract-value-object
[Refactoring]: https://thoughtbot.com/upcase/refactoring

(Rakesh Sukla) #2

I am really not able to understand what exactly we have to do in this exercise? Can someone please elaborate a bit more

(Brent Kearney) #3

In this exercise, you’re supposed to refactor lib/report_card.rb so that it makes use of a Value Object, which is essentially a class that holds an immutable value. The new object is to be for grades, so as you can see from report_card.rb, the method that returns the letter grades is to be replaced.

I found this very helpful: