+ },
+
+ createFragment: function(Type, params) {
+ if(!Type.prototype instanceof fragments.Fragment) {
+ throw new Error('Can\'t create a fragment: `Type` is not a valid Fragment');
+ }
+ return new Type(this, params);
+ }
+});
+
+var Transaction = function(transformations, metadata) {
+ this.transformations = transformations || [];
+ this.metadata = metadata;
+};
+$.extend(Transaction.prototype, {
+ pushTransformation: function(transformation) {
+ this.transformations.push(transformation);
+ },
+ hasTransformations: function() {
+ return this.transformations.length > 0;