Skip to content

Conversation

mitsuru
Copy link

@mitsuru mitsuru commented May 30, 2022

It would be nice to be able to pattern match against OpenStruct.
Inspired by rails/rails#45035

For example:

person = OpenStruct.new(name: 'John', age: 42)
case person
in { name: 'John', age: 42 }
  puts 'John is 42'
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants