module Puppet::Pops::Types::Annotatable

Behaviour common to all Pcore annotatable classes

@api public

Constants

TYPE_ANNOTATIONS

Public Instance Methods

_pcore_init_hash() click to toggle source

@api private

   # File lib/puppet/pops/types/annotatable.rb
30 def _pcore_init_hash
31   result = {}
32   result[KEY_ANNOTATIONS] = @annotations unless @annotations.nil?
33   result
34 end
annotatable_accept(visitor, guard) click to toggle source

@api private

   # File lib/puppet/pops/types/annotatable.rb
25 def annotatable_accept(visitor, guard)
26   @annotations.each_key { |key| key.accept(visitor, guard) } unless @annotations.nil?
27 end
annotations() click to toggle source

@return [{PTypeType => PStructType}] the map of annotations @api public

   # File lib/puppet/pops/types/annotatable.rb
15 def annotations
16   @annotations.nil? ? EMPTY_HASH : @annotations
17 end
init_annotatable(init_hash) click to toggle source

@api private

   # File lib/puppet/pops/types/annotatable.rb
20 def init_annotatable(init_hash)
21   @annotations = init_hash[KEY_ANNOTATIONS].freeze
22 end