Created
December 20, 2014 11:19
-
-
Save errakeshpd/a03abd00787b959cb32c to your computer and use it in GitHub Desktop.
want to replace the (only) the condition when an exception is raised .
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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