Class: Puppet::Pops::Types::PUndefType

Inherits:
PAnyType show all
Defined in:
lib/puppet/pops/types/types.rb

Constant Summary collapse

DEFAULT =
PUndefType.new

Instance Method Summary collapse

Methods inherited from PAnyType

#==, #assignable?, #callable?, #enumerable?, #generalize, #hash, #kind_of_callable?, #simple_name, #to_s

Methods included from Visitable

#accept

Instance Method Details

#callable_args?(callable_t) ⇒ 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.

Returns:

  • (Boolean)


269
270
271
272
# File 'lib/puppet/pops/types/types.rb', line 269

def callable_args?(callable_t)
  # if callable_t is Optional (or indeed PUndefType), this means that 'missing callable' is accepted
  callable_t.assignable?(DEFAULT)
end

#instance?(o) ⇒ Boolean

Returns:

  • (Boolean)


264
265
266
# File 'lib/puppet/pops/types/types.rb', line 264

def instance?(o)
  o.nil? || o == :undef
end