@@ -134,31 +134,38 @@ def self._pcore_type
134
134
def self . register_ptype ( loader , ir )
135
135
tf = Types ::TypeFactory
136
136
key_type = tf . optional ( tf . scalar )
137
- @type = Pcore ::create_object_type ( loader , ir , self , 'Puppet::LookupContext' , 'Any' ,
138
- {
139
- 'environment_name' => {
140
- Types ::KEY_TYPE => Types ::PStringType ::NON_EMPTY ,
141
- Types ::KEY_KIND => Types ::PObjectType ::ATTRIBUTE_KIND_DERIVED
142
- } ,
143
- 'module_name' => {
144
- Types ::KEY_TYPE => tf . variant ( Types ::PStringType ::NON_EMPTY , Types ::PUndefType ::DEFAULT )
145
- }
146
- } ,
147
- {
148
- 'not_found' => tf . callable ( [ 0 , 0 ] , tf . undef ) ,
149
- 'explain' => tf . callable ( [ 0 , 0 , tf . callable ( 0 , 0 ) ] , tf . undef ) ,
150
- 'interpolate' => tf . callable ( 1 , 1 ) ,
151
- 'cache' => tf . callable ( [ key_type , tf . any ] , tf . any ) ,
152
- 'cache_all' => tf . callable ( [ tf . hash_kv ( key_type , tf . any ) ] , tf . undef ) ,
153
- 'cache_has_key' => tf . callable ( [ key_type ] , tf . boolean ) ,
154
- 'cached_value' => tf . callable ( [ key_type ] , tf . any ) ,
155
- 'cached_entries' => tf . variant (
156
- tf . callable ( [ 0 , 0 , tf . callable ( 1 , 1 ) ] , tf . undef ) ,
157
- tf . callable ( [ 0 , 0 , tf . callable ( 2 , 2 ) ] , tf . undef ) ,
158
- tf . callable ( [ 0 , 0 ] , tf . iterable ( tf . tuple ( [ key_type , tf . any ] ) ) )
159
- ) ,
160
- 'cached_file_data' => tf . callable ( tf . string , tf . optional ( tf . callable ( [ 1 , 1 ] ) ) )
161
- } ) . resolve ( loader )
137
+ @type =
138
+ Pcore ::create_object_type (
139
+ loader ,
140
+ ir ,
141
+ self ,
142
+ 'Puppet::LookupContext' ,
143
+ 'Any' ,
144
+ {
145
+ 'environment_name' => {
146
+ Types ::KEY_TYPE => Types ::PStringType ::NON_EMPTY ,
147
+ Types ::KEY_KIND => Types ::PObjectType ::ATTRIBUTE_KIND_DERIVED
148
+ } ,
149
+ 'module_name' => {
150
+ Types ::KEY_TYPE => tf . variant ( Types ::PStringType ::NON_EMPTY , Types ::PUndefType ::DEFAULT )
151
+ }
152
+ } ,
153
+ {
154
+ 'not_found' => tf . callable ( [ 0 , 0 ] , tf . undef ) ,
155
+ 'explain' => tf . callable ( [ 0 , 0 , tf . callable ( 0 , 0 ) ] , tf . undef ) ,
156
+ 'interpolate' => tf . callable ( 1 , 1 ) ,
157
+ 'cache' => tf . callable ( [ key_type , tf . any ] , tf . any ) ,
158
+ 'cache_all' => tf . callable ( [ tf . hash_kv ( key_type , tf . any ) ] , tf . undef ) ,
159
+ 'cache_has_key' => tf . callable ( [ key_type ] , tf . boolean ) ,
160
+ 'cached_value' => tf . callable ( [ key_type ] , tf . any ) ,
161
+ 'cached_entries' => tf . variant (
162
+ tf . callable ( [ 0 , 0 , tf . callable ( 1 , 1 ) ] , tf . undef ) ,
163
+ tf . callable ( [ 0 , 0 , tf . callable ( 2 , 2 ) ] , tf . undef ) ,
164
+ tf . callable ( [ 0 , 0 ] , tf . iterable ( tf . tuple ( [ key_type , tf . any ] ) ) )
165
+ ) ,
166
+ 'cached_file_data' => tf . callable ( tf . string , tf . optional ( tf . callable ( [ 1 , 1 ] ) ) )
167
+ }
168
+ ) . resolve ( loader )
162
169
end
163
170
164
171
# Mainly for test purposes. Makes it possible to create a {Context} in Puppet code provided that a current {Invocation} exists.
0 commit comments