Class | DataMapper::Sweatshop |
In: |
lib/dm-sweatshop/support/class_attributes.rb
lib/dm-sweatshop/sweatshop.rb lib/dm-sweatshop/unique.rb |
Parent: | Object |
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
@return [Array] model map
Returns a Hash of attributes from the model map
@param klass [Class, DataMapper::Resource] @param name [Symbol]
@return [Hash] existing instance of a model from the model map @raise 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
@return [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
@return [DataMapper::Resource] added instance
Returns a Hash with callable values evaluated.
@param hash [Hash]
@return [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
@return [DataMapper::Resource] added instance
Returns a pre existing instance of a model from the record map
@param klass [Class, DataMapper::Resource] @param name [Symbol]
@return [DataMapper::Resource] existing instance of a model from the record map @raise DataMapper::Sweatshop::NoFixtureExist when requested fixture does not exist in the record map
@api private