davidchambers/tutor — pull request #4 by njay (2012-04-03 20:15:30+00:00)
Title: add simple list indices

/sets, /formats and /types return arrays of sets, blocks/formats, and basic types.

The objects in the arrays are just strings, which makes this more a 'because I can' than anything really useful. What I'd really want is objects which represent resources *and* the actions a client can perform on them. For example, each entry in "sets" could have a property "get_set" with the value "set/#{set.name}", so a client could know how to 'click through.' And there'd be an object returned at 'GET /' which would list all the actions together.

But exactly how those objects should be organized is a big design question.

I'd also like to make /format/:format and /type/:type queries some day, although I'm not sure how to handle pagination with queries that are more than 10 pages long. You could just put '>10', or give up on returning a pages property altogether and instead just put in next_page and previous_page links as appropriate.