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
{{ message }}
Instantly share code, notes, and snippets.
Josh Thompson
josh-works
Builder of many things. Communities, friendships, explanatory guides, software, chairs.
From then on, you duplicate that class variable to an instance variable.
The .dup should "protect" you from one test modifying data for another test, which is a concern with class variables.
TLDR. I have two questions, though... the first one got answered after I typed all this up.
How can I access objects inside of another object. (SOMEONE GAVE ME AN ANSWER. Feel free to skip to #2)
I've attached by pry error output and gem list below, as will as troubleshooting and steps to reproduce it on my machine. (It's functionality is intermittent)
More detail on how I got the answer to #1
I was using IRB instead of Pry, couldn't tell that the objects were inside of an array. So, it's an array, so I can iterate through it with all the enumerables.
I'm going to start at Turing School in a few days, and have been eagerly studying in preparation.
There are many, many things I don't yet understand, but I'm trying to slow down and make sure I understand the basics before throwing myself into more complicated things.
One of the things that has been causing me lots of confusion are Enumerators. Mostly because I can use enumerables on both hashes and arrays, and can use it to pick data out of an array or hash, or to insert data into an array or a hash, and at the moment it feels like I'm blindly mashing keys on my keyboard. :(
Specifically, I'm trying to wrap my head around .sort, .each, .inject, and other similar methods, all as it pertains to arrays and hashes.