Class | DataMapper::Sweatshop |
In: |
lib/dm-sweatshop/sweatshop.rb
lib/dm-sweatshop/unique.rb lib/dm-sweatshop/version.rb |
Parent: | Object |
VERSION | = | '0.10.1'.freeze |
model_map | [RW] | |
record_map | [RW] |
Adds a Proc to model map. Proc must return a Hash of attributes.
@param klass [Class, DataMapper::Resource] @param name [Symbol] @param instance [DataMapper::Resource]
@api private
@returns [Array] model map
Returns a Hash of attributes from the model map
@param klass [Class, DataMapper::Resource] @param name [Symbol]
@returns [Hash] existing instance of a model from the model map @raises NoFixtureExist when requested fixture does not exist in the model map
@api private
Creates an instance from given hash of attributes, saves it and adds it to the record map.
@param klass [Class, DataMapper::Resource] @param name [Symbol] @param attributes [Hash]
@api private
@returns [DataMapper::Resource] added instance
Same as create but calls Model#create! and does save invalid models
@param klass [Class, DataMapper::Resource] @param name [Symbol] @param attributes [Hash]
@api private
@returns [DataMapper::Resource] added instance
Returns a Hash with callable values evaluated.
@param hash [Hash]
@returns [Hash] existing instance of a model from the model map
@api private
Creates an instance from given hash of attributes and adds it to records map without saving.
@param klass [Class, DataMapper::Resource] @param name [Symbol] @param attributes [Hash]
@api private
@returns [DataMapper::Resource] added instance
Returns a pre existing instance of a model from the record map
@param klass [Class, DataMapper::Resource] @param name [Symbol]
@returns [DataMapper::Resource] existing instance of a model from the record map @raises DataMapper::Sweatshop::NoFixtureExist when requested fixture does not exist in the record map
@api private