Given: Customer = Struct.new(:name, :address, :zip)
Is there a way to name the arguments instead of presuming a certain order?
The docs say do it like this:
joe = Customer.new("Joe Smith", "123 Maple, Anytown NC", "12345")
which IMO makes it too easy to switch two parameters accidentally.
I'd like to do something like this:
joe = Customer.new(name: "Joe Smith", address: "123 Maple, Anytown NC", zip: "12345")
so that the order is not important:
joe = Customer.new(zip: "12345", name: "Joe Smith", address: "123 Maple, Anytown NC")