Skip to content

Commit 66bcbc0

Browse files
authored
Added explanation on line 125, Ruby tutorial 4
I had trouble understanding the expected outcome when changing the method from protected to private, as the wording implied a different outcome. I got stuck working through this part of the tutorial, and after discussing with my coach, I've changed the wording to be clearer for other students, stating which error is expected and why.
1 parent ded7d45 commit 66bcbc0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ruby/lesson4/tutorial.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ color = Color.new("purple", "#8824a4")
122122
color.update_hexcode("#9427b2")
123123
```
124124

125-
This should now throw a `NoMethodError`. Change **protected** to **private** and run the code again.
125+
This should now throw a `NoMethodError`. Change **protected** to **private** and run the code again. This should still throw a `NoMethodError` since the `update_hexcode` method is being called from outside of the class. Think about how you could call the private method successfully. Remember, the private method needs to be called from within the class.
126126

127127
Let's now put into practise what we have learned so far.
128128

0 commit comments

Comments
 (0)