Access to the LightSide API and a minimal web application demonstrating its use.
The syntax is inspired by Rails ActiveRecord: resources have find taking an id (int or string) and create taking attributes as parameters. Associations can be fetched with a method named as the resource (e.g. lightbox.grader() fetches and returns the grader assigned to lightbox).
This example finds a Lightbox by id and returns its name and Prompt text (through the Grader) as a hash.
lightbox = Lightbox.find(lightbox_id)
grader = lightbox.grader()
prompt = grader.prompt()
return { 'name': lightbox.name(),
'prompt': prompt.text() }