Instantly share code, notes, and snippets.

@Gazer /example1.groovy Secret
Created Nov 23, 2016

Embed
What would you like to do?
List <Map> exerciseEntries = []
dayEntry.exercisesEntries.each { ExerciseEntry exerciseEntry ->
String unit = "min"
Exercise exercise = exerciseEntry.exercise
if (exercise.tags.contains("(floor_count)")) {
unit = "floors"
} else if (exercise.tags.contains("(step_count)")) {
unit = "steps"
}
Map exerciseEntryInfo = [
exercise_id: exercise.exerciseId,
value: exerciseEntry.minutes,
unit: unit
]
exerciseEntries.add(exerciseEntryInfo)
}
resposeData.movement = exerciseEntries
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment