Sha256: 3532feabaa35cf86cf9a7c697d4f3eab4b9562ce6b372fcf600ce1214e6e6342

Contents?: true

Size: 1.37 KB

Versions: 232

Compression:

Stored size: 1.37 KB

Contents

# Represents an entry in the injectors internal data.
#
# @api public
#
class Puppet::Pops::Binder::InjectorEntry
  # @return [Object] An opaque (comparable) object representing the precedence
  # @api public
  attr_reader :precedence

  # @return [Puppet::Pops::Binder::Bindings::Binding] The binding for this entry
  # @api public
  attr_reader :binding

  # @api private
  attr_accessor :resolved

  # @api private
  attr_accessor :cached_producer

  # @api private
  def initialize(binding, precedence = 0)
    @precedence = precedence.freeze
    @binding = binding
    @cached_producer = nil
  end

  # Marks an overriding entry as resolved (if not an overriding entry, the marking has no effect).
  # @api private
  #
  def mark_override_resolved()
    @resolved = true
  end

  # The binding is resolved if it is non-override, or if the override has been resolved
  # @api private
  #
  def is_resolved?()
    !binding.override || resolved
  end

  def is_abstract?
    binding.abstract
  end

  def is_final?
    binding.final
  end

  # Compares against another InjectorEntry by comparing precedence.
  # @param injector_entry [InjectorEntry] entry to compare against.
  # @return [Integer] 1, if this entry has higher precedence, 0 if equal, and -1 if given entry has higher precedence.
  # @api public
  #
  def <=> (injector_entry)
    precedence <=> injector_entry.precedence
  end
end

Version data entries

232 entries across 232 versions & 2 rubygems

Version Path
puppet-4.10.4-universal-darwin lib/puppet/pops/binder/injector_entry.rb
puppet-retrospec-1.4.1 vendor/gems/puppet-4.5.2/lib/puppet/pops/binder/injector_entry.rb
puppet-4.10.1 lib/puppet/pops/binder/injector_entry.rb
puppet-4.10.1-x86-mingw32 lib/puppet/pops/binder/injector_entry.rb
puppet-4.10.1-x64-mingw32 lib/puppet/pops/binder/injector_entry.rb
puppet-4.10.1-universal-darwin lib/puppet/pops/binder/injector_entry.rb
puppet-retrospec-1.4.0 vendor/gems/puppet-4.5.2/lib/puppet/pops/binder/injector_entry.rb
puppet-4.10.0 lib/puppet/pops/binder/injector_entry.rb
puppet-4.10.0-x86-mingw32 lib/puppet/pops/binder/injector_entry.rb
puppet-4.10.0-x64-mingw32 lib/puppet/pops/binder/injector_entry.rb
puppet-4.10.0-universal-darwin lib/puppet/pops/binder/injector_entry.rb
puppet-retrospec-1.3.2 vendor/gems/puppet-4.5.2/lib/puppet/pops/binder/injector_entry.rb
puppet-4.9.4 lib/puppet/pops/binder/injector_entry.rb
puppet-4.9.4-x86-mingw32 lib/puppet/pops/binder/injector_entry.rb
puppet-4.9.4-x64-mingw32 lib/puppet/pops/binder/injector_entry.rb
puppet-4.9.4-universal-darwin lib/puppet/pops/binder/injector_entry.rb
puppet-retrospec-1.3.1 vendor/gems/puppet-4.5.2/lib/puppet/pops/binder/injector_entry.rb
puppet-4.9.3 lib/puppet/pops/binder/injector_entry.rb
puppet-4.9.3-x86-mingw32 lib/puppet/pops/binder/injector_entry.rb
puppet-4.9.3-x64-mingw32 lib/puppet/pops/binder/injector_entry.rb