Skip to content

Instantly share code, notes, and snippets.

@kellyrob99
Created March 28, 2011 21:44
Show Gist options
  • Save kellyrob99/891349 to your computer and use it in GitHub Desktop.
Save kellyrob99/891349 to your computer and use it in GitHub Desktop.
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"
}
@kellyrob99
Copy link
Author

Glad you like it :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment