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
module StringToBoolean | |
def to_bool | |
return true if self == true || self.strip =~ (/\A(true|t|yes|y|1)\Z/i) | |
false | |
end | |
end | |
class String; include StringToBoolean; end | |
module BooleanToBoolean | |
def to_bool;return self; end |