Class: Puppet::Pops::Types::PIteratorType
Constant Summary
collapse
- DEFAULT =
PIteratorType.new(nil)
Instance Attribute Summary
#type
Instance Method Summary
collapse
#accept, #eql?, #generalize, #hash, #initialize, #normalize
Methods inherited from PAnyType
#==, #accept, #assignable?, #callable?, #callable_args?, #eql?, #generalize, #hash, #kind_of_callable?, #normalize, #simple_name, #to_alias_expanded_s, #to_s
Methods included from Visitable
#accept
Instance Method Details
#element_type ⇒ Object
915
916
917
|
# File 'lib/puppet/pops/types/types.rb', line 915
def element_type
@type
end
|
#instance?(o) ⇒ Boolean
919
920
921
|
# File 'lib/puppet/pops/types/types.rb', line 919
def instance?(o)
o.is_a?(Iterable) && (@element_type.nil? || @element_type.assignable?(o.element_type))
end
|
#iterable?(guard = nil) ⇒ Boolean
923
924
925
|
# File 'lib/puppet/pops/types/types.rb', line 923
def iterable?(guard = nil)
true
end
|
#iterable_type(guard = nil) ⇒ Object
927
928
929
|
# File 'lib/puppet/pops/types/types.rb', line 927
def iterable_type(guard = nil)
@type.nil? ? PIteratbleType::DEFAULT : PIterableType.new(@element_type)
end
|