Module: ObjectForge::Molds
- Defined in:
- lib/object_forge/molds.rb,
lib/object_forge/molds/hash_mold.rb,
lib/object_forge/molds/mold_mold.rb,
lib/object_forge/molds/struct_mold.rb,
lib/object_forge/molds/wrapped_mold.rb,
lib/object_forge/molds/keywords_mold.rb,
lib/object_forge/molds/single_argument_mold.rb
Overview
This module provides a collection of predefined molds to be used in common cases.
Molds are #callable objects responsible for actually building objects produced by factories (or doing other, interesting things with them (truly, only the code review is the limit!)). They are supposed to be immutable, shareable, and persistent: initialize once, use for the whole runtime.
A simple mold can easily be just a Proc. All molds must have the following #call signature: call(forged:, attributes:, **). The extra keywords are for future extensions.
Defined Under Namespace
Classes: HashMold, KeywordsMold, MoldMold, SingleArgumentMold, StructMold, WrappedMold