Resource

io.eezo.http.Resource
See theResource companion object
trait Resource[A]

The seven HTML CRUD routes a model mounts.

derives Resource needs a Mirror, a Form and an Actions, and nothing else. Table[A] is not in the chain: http depends on core alone, so the route path is computed here from the class name rather than read off a table name. Storage names and route names now go wrong for different reasons and take different overrides, and a model deriving Form, Resource and no Table mounts seven working routes.

The io.eezo.core.Store arrives as a parameter of routes rather than being summoned, so a test can hand over one it made itself and an unresolved store reports at the call site. It is core's trait and one per model: which implementation a model gets is decided where both db and http are visible, which is the generated route table and nowhere in here.

Attributes

Companion
object
Source
Resource.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Abstract methods

def routes(store: Store[A], guarded: Guarded[A] = ...): Seq[Route]

The routes, in dispatch order.

The routes, in dispatch order.

guarded defaults to Guarded.public so that every call site written before guards existed still compiles and still mounts seven open routes. It is a parameter rather than a summoned given for the same reason the store is one: what a route table decides about a model is decided where the table is written, and an unresolved declaration should report at that line rather than inside a derivation.

Attributes

Source
Resource.scala