Advertisement
Guest User

Untitled

a guest
Jul 30th, 2019
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.23 KB | None | 0 0
  1. class TrueOrFalseString < String
  2.     def initialize(le_string)
  3.         raise ArgumentError, 'Guess what, motherfucker' unless ['true', 'false'].include?(self)
  4.         @le_myself = le_string
  5.     end
  6.     def to_bool
  7.         @le_myself == 'true'
  8.     end
  9. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement