I\'m pretty new to Ruby so apologies if this is an obvious question.
I\'d like to use named parameters when instantiating a Struct, i.e. be able to specify which ite
If your hash keys are in order you can call the splat operator to the rescue:
NavLink = Struct.new(:name, :url, :title) link = { name: 'Stack Overflow', url: 'https://stackoverflow.com', title: 'Sure whatever' } actual_link = NavLink.new(*link.values) #