Created
February 27, 2015 14:38
-
-
Save sheldonh/23cdc31dfb1835605be4 to your computer and use it in GitHub Desktop.
Decomposing fabrique
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
registry = ConstructorRegistry.new("My plugin registry") | |
type = ProviderClass | |
argument_adaptor = ArgumentAdaptor::PositionalArgument.new(:foo, [:bar], :baz) | |
constructor = Constructor.new(type, argument_adaptor) | |
registry.register(:provider1, constructor) | |
factory = Factory.new(registry) | |
provider = factory.create(:provider1, foo: "fooish", baz: "wombat") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment