Created
November 12, 2013 02:07
-
-
Save salami-art/7424227 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#class Class | |
def remove | |
puts "find hash to remove" | |
search = $stdin.gets.chomp.each_line(separator=" ").to_a | |
result = address_book.query search | |
#puts result => returns expected hash | |
address_book.remove result | |
end | |
#class OtherClass | |
attr_accessor :hashs | |
# hashs = [hash1, hash2, ..., hash(n)] | |
# hash = {:a => value, :b => value, :c => value} | |
def remove hash | |
puts hashs.include?(hash) # returns false | |
# puts hashs => works | |
# puts hash => works, expected hash | |
hashs.delete(hash) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment