Class: Puppet::Pops::Binder::Injector::Private::NullInjectorImpl Private
- Defined in:
- lib/puppet/pops/binder/injector.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
This is a mocking “Null” implementation of Injector. It never finds anything
Instance Attribute Summary collapse
- #entries ⇒ Object readonly private
- #key_factory ⇒ Object readonly private
- #type_calculator ⇒ Object readonly private
Instance Method Summary collapse
- #binder ⇒ Object private
- #get_contributions ⇒ Object private
-
#initialize ⇒ NullInjectorImpl
constructor
private
A new instance of NullInjectorImpl.
- #lookup(scope, *args, &block) ⇒ Object private
- #lookup_key(scope, key) ⇒ Object private
- #lookup_producer(scope, *args, &block) ⇒ Object private
- #lookup_producer_key(scope, key) ⇒ Object private
- #lookup_producer_type(scope, type, name = '') ⇒ Object private
Constructor Details
#initialize ⇒ NullInjectorImpl
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of NullInjectorImpl.
356 357 358 359 360 |
# File 'lib/puppet/pops/binder/injector.rb', line 356 def initialize @entries = [] @key_factory = KeyFactory.new() @type_calculator = Types::TypeCalculator.singleton end |
Instance Attribute Details
#entries ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
352 353 354 |
# File 'lib/puppet/pops/binder/injector.rb', line 352 def entries @entries end |
#key_factory ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
353 354 355 |
# File 'lib/puppet/pops/binder/injector.rb', line 353 def key_factory @key_factory end |
#type_calculator ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
354 355 356 |
# File 'lib/puppet/pops/binder/injector.rb', line 354 def type_calculator @type_calculator end |
Instance Method Details
#binder ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
380 381 382 |
# File 'lib/puppet/pops/binder/injector.rb', line 380 def binder nil end |
#get_contributions ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
404 405 406 |
# File 'lib/puppet/pops/binder/injector.rb', line 404 def get_contributions() [] end |
#lookup(scope, *args, &block) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 |
# File 'lib/puppet/pops/binder/injector.rb', line 362 def lookup(scope, *args, &block) raise ArgumentError, "lookup should be called with two or three arguments, got: #{args.size()+1}" unless args.size.between?(1,2) # call block with result if given if block case block.arity when 1 block.call(nil) when 2 block.call(scope, nil) else raise ArgumentError, "The block should have arity 1 or 2" end else val end end |
#lookup_key(scope, key) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
385 386 387 |
# File 'lib/puppet/pops/binder/injector.rb', line 385 def lookup_key(scope, key) nil end |
#lookup_producer(scope, *args, &block) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
390 391 392 |
# File 'lib/puppet/pops/binder/injector.rb', line 390 def lookup_producer(scope, *args, &block) lookup(scope, *args, &block) end |
#lookup_producer_key(scope, key) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
395 396 397 |
# File 'lib/puppet/pops/binder/injector.rb', line 395 def lookup_producer_key(scope, key) nil end |
#lookup_producer_type(scope, type, name = '') ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
400 401 402 |
# File 'lib/puppet/pops/binder/injector.rb', line 400 def lookup_producer_type(scope, type, name='') nil end |