Sorry, “attributes” was a typo. I’m still not getting the reason the scope resolution operator is needed beyond, “this is just the way it is in Ruby.” The lesson explanation:
See that double colon we just used? That’s called the scope resolution operator, which is a fancy way of saying it tells Ruby where you’re looking for a specific bit of code. If we say
Math::PI, Ruby knows to look inside the
Math module to get that
PI, not any other
PI (such as the one we created in
doesn’t make sense to me. Why would
Math::PI be any more specific than
Math.PI dot notation (if that were allowable syntax in Ruby), since both specify the
Math module. Why would it look for the
PI constant anywhere else other than where you specified in the first place? THAT is what I’m totally not getting.
Oh well, I’m just going to keep going through the lessons, and hopefully some point down the road it will make sense.