Increased Data Flexibility: Using Hash for Initialize Argument

Here’s a way to structure your class such that a new data type is less likely to break your code:

So, as you can see above, introducing brand when creating a new store item, item2, doesn’t impact the Class’s ability execute. Data flexibility for the win!

Show your support

Clapping shows how much you appreciated Emily Ekdahl’s story.