Created
July 12, 2012 17:33
-
-
Save philk/3099524 to your computer and use it in GitHub Desktop.
Convert any Ruby object into a Python string (for ERB templates in Chef)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Object | |
| def to_py_bool | |
| (!!self).to_s.capitalize | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment


So what you're saying is that after adding this, we can further obscure our attributes by assigning them differing non-boolean values, and yet they will all end up as the right thing. +1!