Ruby has Integer(...) and Float(...), but does it have Boolean(…) for things like:
Boolean(ENV[“SOME_FLAG”])
What's the Ruby idiom here?
Ruby has Integer(...) and Float(...), but does it have Boolean(…) for things like:
Boolean(ENV[“SOME_FLAG”])
What's the Ruby idiom here?
001> ENV["FLAG"]
=> "false"
002> !!ENV["FLAG"]
=> true
@llimllib @getajobmike but it's not what you want to achieve :)
I use Dry::Types for this.
Dry.Types::Params::Bool[ENV["FLAG"]]