S
Sijo Kg
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
Is this correct?Or any other method?
Sijo
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
Is this correct?Or any other method?
Sijo