-
-
Save kellyrob99/891349 to your computer and use it in GitHub Desktop.
This file contains 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
def company = new Expando() | |
[500000, 399999, 1000000].each{ hops -> | |
company.hops = hops | |
switch(company.hops) | |
{ | |
case 0..99999 : | |
company.rating = 1 | |
break | |
case 100000..399999 : | |
company.rating = 2 | |
break; | |
case 400000..599999 : | |
company.rating = 3 | |
break | |
case 600000..899999 : | |
company.rating = 4 | |
break | |
case {it >= 900000}: | |
company.rating = 5 | |
break | |
} | |
println "Company with hops = $company.hops has rating = $company.rating" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nicely done sir, you are the groovy-man!