Last active
October 6, 2015 10:39
-
-
Save ghiculescu/237838aff13e7e593666 to your computer and use it in GitHub Desktop.
This file contains 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
my_set = JillSet.new | |
my_set.insert("alex") # returns true | |
my_set.insert("jill") # returns true | |
my_set.has?("jill") # returns true | |
my_set.has?("Jill") # returns false | |
my_set.items # returns ["alex", "jill"] | |
my_set.insert("jill") # returns false | |
my_set.has?("jill") # returns true | |
my_set.remove("jill") # returns true | |
my_set.remove("jill") # returns false | |
my_set.items # returns ["alex"] | |
my_set.empty? # returns false | |
my_set.clear! # returns nil (doesn't explicitly return anything) | |
my_set.empty? # returns true | |
my_set.items # returns [] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment