   hide: (el, value) ->
     el.style.display = if value then 'none' else ''
 
+# Bindings that should also be observed for changes on the DOM element in order
+# to propogate those changes back to the model object.
 bidirectionals = ['value', 'checked', 'unchecked', 'selected', 'unselected']
 
+# The rivets module. Exposes a single `bind` function.
 rivets =
   bind: (el, adapter, contexts = {}) ->
     for node in el.getElementsByTagName '*'

          keypath = path.join '.'
          registerBinding node, adapter, type, contexts[context], keypath

if module?
  module.exports = rivets
else

#     rivets.js
#     version : 0.1.2
#     author : Michael Richards
#     license : MIT

# Registers a specific binding routine between a model object and a DOM element.
# All information for that routine is passed in when calling this function; the
# specific element to bind to, an adapter interface for the model object, the
# type of binding, the context object and the keypath at which to subscribe to
# on the model object.
registerBinding = (el, adapter, type, context, keypath) ->
  bind = bindings[type] || attributeBinding type
  bind el, adapter.read context, keypath
