Java Reference
In-Depth Information
Here's a class called GameResult for that purpose:
class GameResult {
String home
String away
String hScore
String aScore
Stadium stadium
String toString() { "$home $hScore, $away $aScore" }
}
Closure Return Values
The last expression in a closure is returned automatically.
This POGO is a simple wrapper for the home and away teams and the home and away
scores, as well as for the stadium. The stadium is needed because it contains the latitude
and longitude values I need for the Google Map. The following listing now shows the com-
plete getGame method in the GetGameData class shown in listing 2.5 .
Listing 2.7. The getGame method in GetGameData.groovy
 
Search WWH ::




Custom Search