Class: Puppet::Pops::Types::PIterableType Private
- Inherits:
-
PTypeWithContainedType
- Object
- TypedModelObject
- PAnyType
- PTypeWithContainedType
- Puppet::Pops::Types::PIterableType
- Defined in:
- lib/puppet/pops/types/types.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Constant Summary collapse
- DEFAULT =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
PIterableType.new(nil)
Instance Attribute Summary
Attributes inherited from PTypeWithContainedType
Class Method Summary collapse
Instance Method Summary collapse
- #element_type ⇒ Object private
- #instance?(o, guard = nil) ⇒ Boolean private
- #iterable?(guard = nil) ⇒ Boolean private
- #iterable_type(guard = nil) ⇒ Object private
Methods inherited from PTypeWithContainedType
#accept, #eql?, #generalize, #hash, #initialize, #normalize, #resolve
Methods inherited from PAnyType
#==, #accept, #assignable?, #callable?, #callable_args?, #check_self_recursion, #create, #eql?, #generalize, #hash, #kind_of_callable?, #name, new_function, #new_function, #normalize, #really_instance?, #resolve, #simple_name, simple_name, #to_alias_expanded_s, #to_s
Methods inherited from TypedModelObject
_ptype, create_ptype, register_ptypes
Methods included from Visitable
Methods included from PuppetObject
Constructor Details
This class inherits a constructor from Puppet::Pops::Types::PTypeWithContainedType
Class Method Details
.register_ptype(loader, ir) ⇒ 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.
1256 1257 1258 1259 1260 1261 1262 1263 |
# File 'lib/puppet/pops/types/types.rb', line 1256 def self.register_ptype(loader, ir) create_ptype(loader, ir, 'AnyType', 'type' => { KEY_TYPE => POptionalType.new(PType::DEFAULT), KEY_VALUE => nil } ) end |
Instance Method Details
#element_type ⇒ 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.
1265 1266 1267 |
# File 'lib/puppet/pops/types/types.rb', line 1265 def element_type @type end |
#instance?(o, guard = nil) ⇒ Boolean
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.
1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 |
# File 'lib/puppet/pops/types/types.rb', line 1269 def instance?(o, guard = nil) if @type.nil? || @type.assignable?(PAnyType::DEFAULT, guard) # Any element_type will do case o when Iterable, String, Hash, Array, Range, PEnumType true when Integer o >= 0 when PIntegerType o.finite_range? else false end else assignable?(TypeCalculator.infer(o), guard) end end |
#iterable?(guard = nil) ⇒ Boolean
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.
1287 1288 1289 |
# File 'lib/puppet/pops/types/types.rb', line 1287 def iterable?(guard = nil) true end |
#iterable_type(guard = nil) ⇒ 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.
1291 1292 1293 |
# File 'lib/puppet/pops/types/types.rb', line 1291 def iterable_type(guard = nil) self end |