From: hanmac@... Date: 2021-03-15T08:08:19+00:00 Subject: [ruby-core:102866] [Ruby master Feature#17718] a method paramaters object that can be pattern matched against Issue #17718 has been updated by Hanmac (Hans Mackowiak). you want `**args` ```ruby def getParam(**args) case args in {zip: zip} p "zip" in {state: s, city: c} p "state+city" in { state: s} p "state" else raise 'need combination of zip, city, state' end end ``` ---------------------------------------- Feature #17718: a method paramaters object that can be pattern matched against https://bugs.ruby-lang.org/issues/17718#change-90926 * Author: dsisnero (Dominic Sisneros) * Status: Open * Priority: Normal ---------------------------------------- def get_perdiem(city: nil, state: nil, zip:nil) case parameters_match # (return an object of the parameters we can pattern match on) in {zip: zip} find_perdiem_by_zip(zip) in {state: s, city: c} find_perdiem_by_state_and_city(s, c) in { state: s} find_perdiem_by_state(s) else raise 'need combination of zip, city,state' end end -- https://bugs.ruby-lang.org/ Unsubscribe: