You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ cat example.rb
require 'open-uri'
require 'json'
data = URI.open('https://api.github.com/repos/ruby/ruby/pulls').read
.then { |body| JSON.parse(body, symbolize_names: true) }
data in [{user: {login:}, title:, created_at:}, *] # match array of hashes, with deep matching inside first hash
p [login, title, created_at]
$ ruby example.rb
example.rb:7: warning: Pattern matching is experimental, and the behavior may change in future versions of Ruby!
["eileencodes", "[Bug #17880] Set leaf false on opt_setinlinecache", "2021-06-11T18:48:30Z"]
https://rubyreferences.github.io/rubychanges/2.7.html#pattern-matching
The text was updated successfully, but these errors were encountered: