Class: Puppet::Pops::Types::PIteratorType
- Inherits:
-
PTypeWithContainedType
- Object
- TypedModelObject
- PAnyType
- PTypeWithContainedType
- Puppet::Pops::Types::PIteratorType
- Defined in:
- lib/puppet/pops/types/types.rb
Constant Summary collapse
- DEFAULT =
PIteratorType.new(nil)
Instance Attribute Summary
Attributes inherited from PTypeWithContainedType
Class Method Summary collapse
Instance Method Summary collapse
- #element_type ⇒ Object
- #instance?(o, guard = nil) ⇒ Boolean
- #iterable?(guard = nil) ⇒ Boolean
- #iterable_type(guard = nil) ⇒ Object
Methods inherited from PTypeWithContainedType
#accept, #eql?, #generalize, #hash, #initialize, #normalize, #resolve
Methods inherited from PAnyType
#==, #accept, #assignable?, #callable?, #callable_args?, #check_self_recursion, #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
Instance Method Details
#element_type ⇒ Object
1334 1335 1336 |
# File 'lib/puppet/pops/types/types.rb', line 1334 def element_type @type end |
#instance?(o, guard = nil) ⇒ Boolean
1338 1339 1340 |
# File 'lib/puppet/pops/types/types.rb', line 1338 def instance?(o, guard = nil) o.is_a?(Iterable) && (@type.nil? || @type.assignable?(o.element_type, guard)) end |
#iterable?(guard = nil) ⇒ Boolean
1342 1343 1344 |
# File 'lib/puppet/pops/types/types.rb', line 1342 def iterable?(guard = nil) true end |
#iterable_type(guard = nil) ⇒ Object
1346 1347 1348 |
# File 'lib/puppet/pops/types/types.rb', line 1346 def iterable_type(guard = nil) @type.nil? ? PIterableType::DEFAULT : PIterableType.new(@type) end |