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

Boolean(ENV[“SOME_FLAG”])

What's the Ruby idiom here?

@getajobmike I’m not aware of anything built-in to Ruby, but there is ‘ActiveModel::Type::Boolean#cast’.

@floehopper @getajobmike yeah, if ruby provided it, I assume it'd look something like this.

https://api.rubyonrails.org/classes/ActiveModel/Type/Boolean.html

ActiveRecord::Type::Boolean

Active Model Boolean Type A class that behaves like a boolean type, including rules for coercion of user input.