Module: Factrey
- Defined in:
- lib/factrey.rb,
lib/factrey/dsl.rb,
lib/factrey/ref.rb,
lib/factrey/dsl/on.rb,
lib/factrey/dsl/let.rb,
lib/factrey/version.rb,
lib/factrey/blueprint.rb,
lib/factrey/ref/defer.rb,
lib/factrey/ref/builder.rb,
lib/factrey/ref/resolver.rb,
lib/factrey/blueprint/node.rb,
lib/factrey/blueprint/type.rb,
lib/factrey/ref/shorthand_methods.rb,
lib/factrey/blueprint/instantiator.rb
Overview
Factrey provides a declarative DSL to represent the creation plan of objects.
Defined Under Namespace
Constant Summary collapse
- VERSION =
"0.2.0"
Class Method Summary collapse
-
.blueprint(blueprint = nil, ext: nil, dsl: DSL) { ... } ⇒ Blueprint
Entry point to build or extend a Blueprint.
Class Method Details
.blueprint(blueprint = nil, ext: nil, dsl: DSL) { ... } ⇒ Blueprint
Entry point to build or extend a Blueprint.
35 36 37 38 39 40 41 42 |
# File 'lib/factrey.rb', line 35 def blueprint(blueprint = nil, ext: nil, dsl: DSL, &) raise TypeError, "blueprint must be a Blueprint" if blueprint && !blueprint.is_a?(Blueprint) raise TypeError, "dsl must be a subclass of DSL" unless dsl <= DSL blueprint ||= Blueprint.new blueprint.define_result dsl.new(blueprint:, ext:).instance_exec(&) if block_given? blueprint end |