These two methods are great for confirming keys and values in hashes before executing other code. [1] pry(main)> db = {} => {} [2] pry(main)> db["party"] = "time" => "time" [3] pry(main)> db.keys => ["party"] [4] pry(main)> db.values => ["time"] Considering the following these can be very beneficial. # API Endpoint def recent_logs return nil unless params.keys.include("report_id") # execute more code end :)