class Puppet::Pops::Types::PTypeWithContainedType

@abstract Encapsulates common behavior for a type that contains one type @api public

Attributes

type[R]

Public Class Methods

new(type) click to toggle source
    # File lib/puppet/pops/types/types.rb
421 def initialize(type)
422   @type = type
423 end
register_ptype(loader, ir) click to toggle source
    # File lib/puppet/pops/types/types.rb
415 def self.register_ptype(loader, ir)
416   # Abstract type. It doesn't register anything
417 end

Public Instance Methods

accept(visitor, guard) click to toggle source
Calls superclass method Puppet::Pops::Types::PAnyType#accept
    # File lib/puppet/pops/types/types.rb
425 def accept(visitor, guard)
426   super
427   @type.accept(visitor, guard) unless @type.nil?
428 end
eql?(o) click to toggle source
    # File lib/puppet/pops/types/types.rb
452 def eql?(o)
453   self.class == o.class && @type == o.type
454 end
generalize() click to toggle source
    # File lib/puppet/pops/types/types.rb
430 def generalize
431   if @type.nil?
432     self.class::DEFAULT
433   else
434     ge_type = @type.generalize
435     @type.equal?(ge_type) ? self : self.class.new(ge_type)
436   end
437 end
hash() click to toggle source
    # File lib/puppet/pops/types/types.rb
448 def hash
449   self.class.hash ^ @type.hash
450 end
normalize(guard = nil) click to toggle source
    # File lib/puppet/pops/types/types.rb
439 def normalize(guard = nil)
440   if @type.nil?
441     self.class::DEFAULT
442   else
443     ne_type = @type.normalize(guard)
444     @type.equal?(ne_type) ? self : self.class.new(ne_type)
445   end
446 end
resolve(loader) click to toggle source
    # File lib/puppet/pops/types/types.rb
456 def resolve(loader)
457   rtype = @type
458   rtype = rtype.resolve(loader) unless rtype.nil?
459   rtype.equal?(@type) ? self : self.class.new(rtype)
460 end