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 420 def initialize(type) 421 @type = type 422 end
register_ptype(loader, ir)
click to toggle source
# File lib/puppet/pops/types/types.rb 414 def self.register_ptype(loader, ir) 415 # Abstract type. It doesn't register anything 416 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 424 def accept(visitor, guard) 425 super 426 @type.accept(visitor, guard) unless @type.nil? 427 end
eql?(o)
click to toggle source
# File lib/puppet/pops/types/types.rb 451 def eql?(o) 452 self.class == o.class && @type == o.type 453 end
generalize()
click to toggle source
# File lib/puppet/pops/types/types.rb 429 def generalize 430 if @type.nil? 431 self.class::DEFAULT 432 else 433 ge_type = @type.generalize 434 @type.equal?(ge_type) ? self : self.class.new(ge_type) 435 end 436 end
hash()
click to toggle source
# File lib/puppet/pops/types/types.rb 447 def hash 448 self.class.hash ^ @type.hash 449 end
normalize(guard = nil)
click to toggle source
# File lib/puppet/pops/types/types.rb 438 def normalize(guard = nil) 439 if @type.nil? 440 self.class::DEFAULT 441 else 442 ne_type = @type.normalize(guard) 443 @type.equal?(ne_type) ? self : self.class.new(ne_type) 444 end 445 end
resolve(loader)
click to toggle source
# File lib/puppet/pops/types/types.rb 455 def resolve(loader) 456 rtype = @type 457 rtype = rtype.resolve(loader) unless rtype.nil? 458 rtype.equal?(@type) ? self : self.class.new(rtype) 459 end