| Module | Mack::Data::Factory |
| In: |
lib/mack-data_factory/content_generator.rb
lib/mack-data_factory/data_factory.rb |
Add factory capability to a class.
A factory is able to define which field it want to generate content for, define a scope for different situation, and set a custom content generator for field that doesn‘t want to use the default content generator.
You must add this module when creating a factory class; and the name of the factory class should be following this format:
#{model_name_camelcase}Factory
Example:
If there's a model class named "Item", then its factory must be:
class ItemFactory
include Mack::Data::Factory
...
end
See Mack::Data::Factory::ClassMethods for the factory API and examples.
| Author: | Darsono Sutedja |
| Date: | July 2008 |