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!

Like what you read? Give Emily Ekdahl a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.