seems like `when 'true' then true` and `when 'false' then false` might be useful here?  Also, how can `nil` ever be the value?

In any case, wouldn't it make sense to accept, eg, `TRUE` as a true value here?  Case sensitive feels ick, to say the least.  Might be good to accept, eg, `on`, `yes`, `1`, etc as well.  Since we know this is intended to be a boolean, we don't have the ambiguity of trying to guess intent, so being liberal in what we accept is reasonable.