ostruct
ostruct copied to clipboard
Provide pattern matching for OpenStruct
It would be nice to be able to pattern match against OpenStruct. Inspired by https://github.com/rails/rails/pull/45035
For example:
person = OpenStruct.new(name: 'John', age: 42)
case person
in { name: 'John', age: 42 }
puts 'John is 42'
end