1. Blake Sweeney
  2. match

Overview

HTTPS SSH

Match

Some pattern matching tools for ruby. This abuses the case operator to do things like let me define a hash to match against. Basically my goald was to do things like:

pattern = { 'some-key' => /[\w+_]/, 'other-key' => Integer }
data = { 'some-key' => 'some_value', 'other-key' => 4 }
pattern === data # => true

and see that they match. This is pretty useful for how I write API endpoints.

Author

Blake Sweeney blakes.85@gmail.com