I am processing data from an array which basically involves me searching
for specific information and outputting the results that match eg.
…
if data == 100
puts “#{data.time_written}”
I have just inserted a step which adds some additional criteria. This
states if you find data that equals 100 does it happens more than 10
times in one day.
This all works fine. What i want is some kind of nested if statement
thats does the following:
if data == 100
if data happens more than 5 times in one day
print out the results of all the data that equals 100 but highlight
(colour code, italics etc)the data within the results that happens more
than 5 times in a day.
This is how I’d do it: first build an histogram of the data. In this
case
you want to count how many there are of a combination of data and day.
Then print the array checking against the histogram for choosing style: