Sha256: 336c16a7811bfacf707e0e05cc54edf3c72e7e5cd8eb7b249adbb820f7e156bf

Contents?: true

Size: 920 Bytes

Versions: 4

Compression:

Stored size: 920 Bytes

Contents

module Puppet::Pops
module Types

# Marker module for implementations that are mapped to Object types
# @api public
module PuppetObject
  # Returns the Puppet Type for this instance. The implementing class must
  # add the {#_pcore_type} as a class method.
  #
  # @return [PObjectType] the type
  def _pcore_type
    t = self.class._pcore_type
    if t.parameterized?
      unless instance_variable_defined?(:@_cached_ptype)
        # Create a parameterized type based on the values of this instance that
        # contains a parameter value for each type parameter that matches an
        # attribute by name and type of value
        @_cached_ptype = PObjectTypeExtension.create(t, self)
      end
      t = @_cached_ptype
    end
    t
  end

  def _pcore_all_contents(path, &block)
  end

  def _pcore_contents
  end

  def _pcore_init_hash
    {}
  end

  def to_s
    TypeFormatter.string(self)
  end
end
end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
bolt-0.11.0 vendored/puppet/lib/puppet/pops/types/puppet_object.rb
bolt-0.10.0 vendored/puppet/lib/puppet/pops/types/puppet_object.rb
bolt-0.9.0 vendored/puppet/lib/puppet/pops/types/puppet_object.rb
bolt-0.8.0 vendored/puppet/lib/puppet/pops/types/puppet_object.rb