Extras Handy Commands Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

If you want to compare the date written as a string to an actual date object, like Date.today. How would you do this?

A

def card_expired?(exp_date)
Date.strptime(exp_date, ‘%m/%y’)
end

How well did you know this?
1
Not at all
2
3
4
5
Perfectly