Skip to content

Instantly share code, notes, and snippets.

@fedesilva
Created October 1, 2010 23:33
Show Gist options
  • Save fedesilva/607063 to your computer and use it in GitHub Desktop.
Save fedesilva/607063 to your computer and use it in GitHub Desktop.
// Vals en el constructor son propiedades:
// p = Person("fede","silva", 10 )
// p.first
case class Person( val first:String, val last:String, val age:Int )
// Como si fuera statics:
// Person.key
object Person extends Mapper[Person] {
def key = first
val first = "first" is { _.first } // "name" is accesor
val last = "last" is { _.last }
val age = "age" is { _.age }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment