Hi
I have created an array like
def checkdata(data)
@passed_effort= data.split(':').collect! {|n| n}
hours = @passed_effort[0]
minutes = @passed_effort[1]
@error_checked_value=Array.new
if hours =~ /\D/ || minutes =~ /\D/ @error_checked_value << 'nonnumeric'
end
if minutes.to_i > 59 @error_checked_value << 'notinrange'
end
return @error_checked_value
end
Now how can I iterate through this array @error_checked_value.each do |val|
puts val
end
Using each is the most common way to iterate an array. Is there
something more than puts-ing each value that you want to do that
caused you to ask your question?