CRUDtree

Summary

A resource helper mainly for usher, but may be adapted for other routers as well.

See

Usher

github.com/joshbuddy/usher

IRC

#[email protected]

Baretest

github.com/apeiros/baretest

Terminology

Master

The main body, only one per Usher instance as well.

Node

You attach other Nodes or EndNodes as subnodes here.

EndNode

A route endpoint.

Usage

as Tinkerer

CRUDtree::Interface.for(:usher_rack, rango: true).add_helper(CRUDtree::Interface::Helper)

Usher::Interface.for(:rack) do
  node(klass: Posts) do
    sub(type: :member, call: :show, rest: :get)
    sub(type: :collection, call: :index, rest: :get)
  end
end

As Dev

CRUDtree::Interface.for(:usher_rack, rango: true)

Usher::Interface.for(:rack) do
  resource(klass: Posts) do # the resource helper will include a bunch of default routes
    member(call: :show, rest: :get)
    collection(call: :index, rest: :get)
  end
end