ostruct icon indicating copy to clipboard operation
ostruct copied to clipboard

Provide pattern matching for OpenStruct

Open mitsuru opened this issue 3 years ago • 0 comments

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

mitsuru avatar May 30 '22 13:05 mitsuru