I have a value that will be one of four things: boolean true, boolean false, the string \"true\", or the string \"false\". I want to convert the string to a boolean if it i
h = { "true"=>true, true=>true, "false"=>false, false=>false } ["true", true, "false", false].map { |e| h[e] } #=> [true, true, false, false]