Module: FakerMaker::LifecycleHooks::DefinitionProxy
- Included in:
- DefinitionProxy
- Defined in:
- lib/faker_maker/lifecycle_hooks.rb
Overview
Lifecycle hooks which can be called during the building of an instance
Instance Method Summary collapse
Instance Method Details
#after_build ⇒ Object
11 12 13 |
# File 'lib/faker_maker/lifecycle_hooks.rb', line 11 def after_build @factory.define_singleton_method(:after_build) { yield(instance, self) } end |
#before_build ⇒ Object
7 8 9 |
# File 'lib/faker_maker/lifecycle_hooks.rb', line 7 def before_build @factory.define_singleton_method(:before_build) { yield(instance, self) } end |