J
junkone
class ReportBuilder
countExch=Hash.new
def getStats(symbolObjColl)
startCounter=0
#### add a loop to count thro symbolcollection.
symbolObjColl.each{|eachSymbolObj|
if (countExch.has_key?(eachSymbolObj.exchange))
countExch[eachSymbolObj.exchange]=countExch[eachSymbolObj.exchange]+=1
else
countExch[eachSymbolObj.exchange]=startCounter+=1;
end
}
puts countExch.to_s
end
end
I get the folliwng error.
1) Error:
Test_ReportBuilder#test_Case1:
NameError: undefined local variable or method `countExch' for
#<ReportBuilder:0xd29af88>
I am not sure what is wrong.
Seede
countExch=Hash.new
def getStats(symbolObjColl)
startCounter=0
#### add a loop to count thro symbolcollection.
symbolObjColl.each{|eachSymbolObj|
if (countExch.has_key?(eachSymbolObj.exchange))
countExch[eachSymbolObj.exchange]=countExch[eachSymbolObj.exchange]+=1
else
countExch[eachSymbolObj.exchange]=startCounter+=1;
end
}
puts countExch.to_s
end
end
I get the folliwng error.
1) Error:
Test_ReportBuilder#test_Case1:
NameError: undefined local variable or method `countExch' for
#<ReportBuilder:0xd29af88>
I am not sure what is wrong.
Seede