I created a class method that iterates through an array of Order objects. I use the data from there to create a hash. One of my if blocks is inside iterable:
if !(report_hash[user_id][reason])
report_hash[user_id][reason] = 1
else
report_hash[user_id][reason]++
end
When I run this method, I get:
.rb:66 syntax error, unexpected keyword_end (SyntaxError)
Line 66 is where it is end. Why doesn't Ruby expect the end of this block to end? I plan to move all the conditional logic into separate class methods when everything works, but I tried to figure it out and got a little stuck.
source
share