Module: Puppet::Pops::Types::Annotatable
- Included in:
- PMetaType, PObjectType::PAnnotatedMember, TypeSetReference
- Defined in:
- lib/puppet/pops/types/annotatable.rb
Overview
Behaviour common to all Pcore annotatable classes
Constant Summary collapse
- TYPE_ANNOTATION_KEY_TYPE =
TBD
PType::DEFAULT
- TYPE_ANNOTATION_VALUE_TYPE =
TBD
PStructType::DEFAULT
- TYPE_ANNOTATIONS =
PHashType.new(TYPE_ANNOTATION_KEY_TYPE, TYPE_ANNOTATION_VALUE_TYPE)
Instance Attribute Summary collapse
-
#annotations ⇒ {PType => PStructType}
readonly
The map of annotations.
Instance Method Summary collapse
- #annotatable_accept(visitor, guard) ⇒ Object private
- #i12n_hash ⇒ Object private
- #init_annotatable(i12n_hash) ⇒ Object private
Instance Attribute Details
#annotations ⇒ {PType => PStructType} (readonly)
Returns the map of annotations.
16 17 18 |
# File 'lib/puppet/pops/types/annotatable.rb', line 16 def annotations @annotations end |
Instance Method Details
#annotatable_accept(visitor, guard) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
24 25 26 |
# File 'lib/puppet/pops/types/annotatable.rb', line 24 def annotatable_accept(visitor, guard) @annotations.each_key { |key| key.accept(visitor, guard) } unless @annotations.nil? end |
#i12n_hash ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
29 30 31 32 33 |
# File 'lib/puppet/pops/types/annotatable.rb', line 29 def i12n_hash result = {} result[KEY_ANNOTATIONS] = @annotations unless @annotations.nil? result end |
#init_annotatable(i12n_hash) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
19 20 21 |
# File 'lib/puppet/pops/types/annotatable.rb', line 19 def init_annotatable(i12n_hash) @annotations = i12n_hash[KEY_ANNOTATIONS].freeze end |