Expand match_ok and match_err to optionally receive a contract as the second argument:
result = some_method
case result
when match_ok(:ok, Contract) then 'has status :ok and underlying data matches Contract'
when match_ok(:ok) then 'other results with status :ok'
when match_ok then 'successful results with status different to :ok'
end
Expand
match_okandmatch_errto optionally receive a contract as the second argument: