Reputation: 20222
I am adding an element to a set and although the element can be found in the set later, the include?
method returns false
when I search for it.
@used_date_first.add(fe.time.beginning_of_day)
p "#{@used_date_first.include?(fe.time.beginning_of_day)}"
prints
false
The set is declared like this:
@used_date_first = Set.new
Upvotes: 0
Views: 16
Reputation: 4705
I believe there's an issue with your 'fe' var.
If I do this:
x = DateTime.now.beginning_of_day
@used_date_first.add(x)
p "#{@used_date_first.include?(x)}"
it prints true
Upvotes: 1