Permalink
Browse files

Add documentation for Mappable mixin

  • Loading branch information...
Addepar Pairing Station Addepar Pairing Station
Addepar Pairing Station authored and Addepar Pairing Station committed Oct 30, 2012
1 parent 03fe9bf commit ca0ab37fbe9d0afdc896c7a8410e27cafabfb203
Showing with 20 additions and 0 deletions.
  1. +20 −0 packages/ember-data/lib/system/mixins/mappable.js
@@ -1,5 +1,25 @@
var classify = Ember.String.classify, get = Ember.get;
/**
@private
The Mappable mixin is designed to assist classes that need supply a mapping
API on their class, then reify that mapping to make it available on their
instances.
For example, DS.Store uses this mixin to implement the `registerAdapter` API.
API consumers can call `registerAdapter`, which adds entries to the
`_adaptersMap` private property.
The first time an adapter is looked up, the instance calls `_reifyMappings`
with the mapping name. This collapse all of the registered mappings in the
entire class hierarchy into a mapping on the instance.
This mixin is not currently designed for public consumption. It's API does
not yet expose the firm yet yielding API contours that Ember.js developers
expect. If you want to make this available more broadly, please clean it up
first.
*/
DS.Mappable = Ember.Mixin.create({
_reifyMappings: function(mappingName) {
var mappingsKey = '_' + mappingName + 'Map',

0 comments on commit ca0ab37

Please sign in to comment.