Skip to content

Instantly share code, notes, and snippets.

@errakeshpd
Created December 20, 2014 11:19
Show Gist options
  • Save errakeshpd/a03abd00787b959cb32c to your computer and use it in GitHub Desktop.
Save errakeshpd/a03abd00787b959cb32c to your computer and use it in GitHub Desktop.
want to replace the (only) the condition when an exception is raised .
if cols[1] == 12
-------------------------
-------------------------
-------------------------
-------------------------
-------------------------
-------------------------
end
this fails when the cols[1] is reading from csv . its considering as string
begin
if cat_sub_id.match(/^\d+$/) // if this not raised an exception
if cols[1].to_i == 12 //then this if have to take
rescue
if cols[1] == 12 // if raise an exception then this have to take
end
-------------------------
-------------------------
-------------------------
-------------------------
-------------------------
-------------------------
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment