-
dio
Dio - Dive Into Objects - Ruby Pattern Matching interface for Objects which have none (yet) (by baweaver)
-
Scout Monitoring
Rennaisance engineers rejoice! 1 gem 5 min to app monitoring. 5-minute onboarding. No sales team. Devs in the support channels. No DevOps team required. Get the free app insights every engineer deserves with Scout Monitoring.
-
HTTP
HTTP (The Gem! a.k.a. http.rb) - a fast Ruby HTTP client with a chainable API, streaming support, and timeouts
Pattern matching interfaces can be simulated using gems such as Dio for testing purposes. It does not act as a replacement, but rather a stand-in to test interfaces without full implementations.
In the case of most applications the performance implication of using public_send should not be enough to cause concern, but there are tricks to dynamically compile against this using eval in case performance becomes an issue.
Deconstructable - Simpler version of Matchable, same idea behind it
There are cases which exist, such as s-expressions, where this recommendation does not necessarily hold true. Marc-Andre had noted this in a pull request to the Whitequark AST gem, using the following implementation instead:
I had submitted a PR against this repo, but I believe the two most interesting types to match against are responses and requests:
Note: This was merged into Ruby: https://github.com/ruby/ruby/pull/6216