Ruby has Integer(...) and Float(...), but does it have Boolean(…) for things like:

Boolean(ENV[“SOME_FLAG”])

What's the Ruby idiom here?

@getajobmike Nancy Sinatra it:

Bang bang (my baby shot me down)

@Schneems

irb(main):003> ENV["FOO"] = "0"
=> "0"
irb(main):004> !!ENV["FOO"]
=> true

Would you expect this behavior?

maybe_so/lib/maybe_so/core_ext at main · planningcenter/maybe_so

Ruby boolean type casting. Contribute to planningcenter/maybe_so development by creating an account on GitHub.

GitHub