How to find the minimum value from the ranges in array of hashes in ruby? - Get link Facebook X Pinterest Email Other Apps - July 15, 2012 i have below array of hashes z = {"range"=>[{"10-50"=>"5"}, {"50-100"=>"15"}, {"100-150"=>"25"}]} how can output 10 you can try following: z["range"].map(&:keys).flatten.map(&:to_i).min #=> 10 demo Get link Facebook X Pinterest Email Other Apps Comments
Comments
Post a Comment