A bindings builder for an AbstractBinding containing other AbstractBinding instances. @api public
Adds an empty binding to the container, and returns a builder for it for further detailing. An optional block may be given which is evaluated using `instance_eval`. @return [BindingsBuilder] the builder for the created binding @api public
# File lib/puppet/pops/binder/bindings_factory.rb, line 134 def bind(&block) binding = Puppet::Pops::Binder::Bindings::Binding.new() model.addBindings(binding) builder = BindingsBuilder.new(binding) builder.instance_eval(&block) if block_given? builder end
Binds a multibind with the given identity where later, the looked up result contains all contributions to this key. An optional block may be given which is evaluated using `instance_eval`. @param id [String] the multibind’s id used when adding contributions @return [MultibindingsBuilder] the builder for the created multibinding @api public
# File lib/puppet/pops/binder/bindings_factory.rb, line 148 def multibind(id, &block) binding = Puppet::Pops::Binder::Bindings::Multibinding.new() binding.id = id model.addBindings(binding) builder = MultibindingsBuilder.new(binding) builder.instance_eval(&block) if block_given? builder end