This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.lshoo.model | |
import net.liftweb._ | |
import record.field._ | |
import mongodb.record.{MongoRecord, MongoMetaRecord, MongoId} | |
import mongodb.{JsonObject, JsonObjectMeta} | |
import mongodb.record.field._ | |
object BookMongo extends BookMongo with MongoMetaRecord[BookMongo] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Publisher.scala | |
package com.lshoo.liftinaction.model | |
import net.liftweb.mapper._ | |
import net.liftweb.util.Helpers._ | |
import com.lshoo.model.Book | |
class Publisher extends LongKeyedMapper[Publisher] | |
with CreatedUpdated with IdPK | |
with OneToMany[Long, Publisher]{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ch21 | |
class PreferredPrompt(val preference: String) | |
object JoesPrefs { | |
implicit val prompt = new PreferredPrompt("Yes, master> ") | |
} | |
object Greeter { | |
def greet(name: String)(implicit prompt: PreferredPrompt) { | |
println("Welcome, " + name + ". The system is readey") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ch20 | |
object WeekDayDemo { | |
object WeekDay extends Enumeration { | |
type WeekDay = Value | |
val Mon, Tue, Web, Thu, Fri, Sat, Sun = Value | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ch20 | |
object Color extends Enumeration { | |
val RED = Value("abcdefg") | |
val GREEN, BLUE = Value | |
val yellow = Value | |
val Orange = Value | |
//override def toString = Value.toString.toLowerCase | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait Queue[T] { | |
def head: T | |
def tail: Queue[T] | |
def enqueue(x: T): Queue[T] | |
} | |
object Queue { | |
private class QueueImpl[T] ( | |
private val leading: List[T], |
NewerOlder