Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class TrueOrFalseString < String
- def initialize(le_string)
- raise ArgumentError, 'Guess what, motherfucker' unless ['true', 'false'].include?(self)
- @le_myself = le_string
- end
- def to_bool
- @le_myself == 'true'
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement