Created
November 27, 2009 17:01
-
-
Save brapse/244120 to your computer and use it in GitHub Desktop.
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
product_format = /(FIXED|ARM)-(\d{1,2})(?:-(REFINANCE|PURCHASE))?(?:-(FHA))?(?:-(JUMBO))?/ | |
product_format_mapping = {:interest_type => 1, :term => 2, :mortgage_type => 3, :fha => 4, :jumbo => 5 } | |
product_hash = {} | |
product_format_mapping.map do |field, index| | |
product_hash[field] = product_string.match(product_format)[index] | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment