Skip to content

Instantly share code, notes, and snippets.

@systay
Created April 19, 2011 19:30
Show Gist options
  • Save systay/929383 to your computer and use it in GitHub Desktop.
Save systay/929383 to your computer and use it in GitHub Desktop.
class Projection(source: Pipe, transformers: List[(Map[String, Any]) => (Map[String, Any])]) extends Traversable[Map[String, Any]] {
def foreach[U](f: (Map[String, Any]) => U) {
source.foreach((m) => {
transformers.map((transformer) => transformer.apply(m)).reduceLeft(_ ++ _)
})
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment