Skip to content

Instantly share code, notes, and snippets.

@practicingruby
Created August 28, 2012 17:54
Show Gist options
  • Select an option

  • Save practicingruby/3501408 to your computer and use it in GitHub Desktop.

Select an option

Save practicingruby/3501408 to your computer and use it in GitHub Desktop.
def generate_options(condition)
case condition.to_s
when "invalid_reg_exp"
{:response_msg => "Validation Failed(NON-SMTP)",:status=>"FAILED",:email_status=>"INVALID"}
when "free_domain"
{:response_msg => "Free Domain",:status=>"FAILED",:email_status=>"NEUTRAL"}
when "server_failure"
{:response_msg => "Mail Server Not Connected",:status=>"FAILED",:email_status=>"NEUTRAL"}
when "valid"
{:response_msg => condition.response,:status=>"VERIFIED",:email_status=>"VALID"}
when "invalid"
{:response_msg => condition.response,:status=>"FAILED",:email_status=>"INVALID"}
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment