Created
November 9, 2014 09:33
-
-
Save bararchy/74b789f46e2dad137a6b 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
@cookies = [] | |
@cookies << ["1234", Time.now, "this will be deleted"] | |
sleep 1 | |
@cookies << ["1234", Time.now + 1, "this also should be deleted"] | |
sleep 1 | |
@cookies << ["1234", Time.now + 60, "this wont be deleted"] | |
sleep 5 | |
puts "This is the whole array: ", @cookies | |
for cookie in @cookies | |
puts "This is one cookie in the array: ", cookie[1], Time.now | |
if cookie[1] < Time.now | |
@cookies.reject! {|entry| entry == cookie } | |
end | |
end | |
puts "This is what left: ", @cookies |
zenspider
commented
Nov 9, 2014
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment