Skip to content

Instantly share code, notes, and snippets.

@workmad3
Created June 16, 2010 14:26
Show Gist options
  • Select an option

  • Save workmad3/440776 to your computer and use it in GitHub Desktop.

Select an option

Save workmad3/440776 to your computer and use it in GitHub Desktop.
class String
def !@
return "fail" if self == "win"
return "win" if self == "fail"
return !self.to_bool
end
def to_bool
return true if self == "true"
return false if self == "false"
return nil
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment