Sha256: 4998da26e5321fc33722607704670b3a6074171ab2a8093db8fa0b37150f0c2b

Contents?: true

Size: 1.31 KB

Versions: 80

Compression:

Stored size: 1.31 KB

Contents

# An implementation of the interface Puppet::Resource
# that adapts the 3.x compiler and catalog expectations on
# a resource instance. This instance is backed by a
# pcore representation of the resource type an instance of this
# ruby class.
#
# This class must inherit from Puppet::Resource because of the
# class expectations in existing logic.
#
# This implementation does not support
# * setting 'strict' - strictness (must refer to an existing type) is always true
# * does not support the indirector
#
#
module Puppet::Pops
module Resource
class Param
  # This make this class instantiateable from Puppet
  include Puppet::Pops::Types::PuppetObject

  def self.register_ptype(loader, ir)
    @ptype = Pcore::create_object_type(loader, ir, self, 'Puppet::Resource::Param', nil,
      {
        Types::KEY_TYPE => Types::PType::DEFAULT,
        Types::KEY_NAME => Types::PStringType::NON_EMPTY,
        'name_var' => {
          Types::KEY_TYPE => Types::PBooleanType::DEFAULT,
          Types::KEY_VALUE => false
        }
      },
      EMPTY_HASH,
      [Types::KEY_NAME]
    )
  end

  attr_reader :name
  attr_reader :type
  attr_reader :name_var

  def initialize(type, name, name_var = false)
    @type = type
    @name = name
    @name_var = name_var
  end

  def to_s
    name
  end

  def self._ptype
    @ptype
  end
end
end
end

Version data entries

80 entries across 80 versions & 2 rubygems

Version Path
puppet-retrospec-1.8.0 vendor/pup410/lib/puppet/pops/resource/param.rb
puppet-retrospec-1.7.0 vendor/pup410/lib/puppet/pops/resource/param.rb
puppet-4.10.12 lib/puppet/pops/resource/param.rb
puppet-4.10.12-x86-mingw32 lib/puppet/pops/resource/param.rb
puppet-4.10.12-x64-mingw32 lib/puppet/pops/resource/param.rb
puppet-4.10.12-universal-darwin lib/puppet/pops/resource/param.rb
puppet-4.10.11 lib/puppet/pops/resource/param.rb
puppet-4.10.11-x86-mingw32 lib/puppet/pops/resource/param.rb
puppet-4.10.11-x64-mingw32 lib/puppet/pops/resource/param.rb
puppet-4.10.11-universal-darwin lib/puppet/pops/resource/param.rb
puppet-4.10.10 lib/puppet/pops/resource/param.rb
puppet-4.10.10-x86-mingw32 lib/puppet/pops/resource/param.rb
puppet-4.10.10-x64-mingw32 lib/puppet/pops/resource/param.rb
puppet-4.10.10-universal-darwin lib/puppet/pops/resource/param.rb
puppet-retrospec-1.6.1 vendor/pup410/lib/puppet/pops/resource/param.rb
puppet-retrospec-1.6.0 vendor/pup410/lib/puppet/pops/resource/param.rb
puppet-4.10.9 lib/puppet/pops/resource/param.rb
puppet-4.10.9-x86-mingw32 lib/puppet/pops/resource/param.rb
puppet-4.10.9-x64-mingw32 lib/puppet/pops/resource/param.rb
puppet-4.10.9-universal-darwin lib/puppet/pops/resource/param.rb