Skip to content
Snippets Groups Projects
Commit eb7ea398 authored by Mauricio Giacomini Girardello's avatar Mauricio Giacomini Girardello
Browse files

adding to_bool method for ruby String objects

parent 66f7aa4e
No related branches found
No related tags found
No related merge requests found
class String
def to_bool
value = to_str
!(value.nil? || value == "" || value =~ /^(false|f|no|n|0)$/i || value == false)
end
end
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment