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

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

Constant Summary collapse

DEFAULT =
PUndefType.new

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from PAnyType

#==, #accept, #assignable?, #callable?, #check_self_recursion, #eql?, #generalize, #hash, #iterable?, #iterable_type, #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

#accept

Methods included from PuppetObject

#_ptype

Class Method Details

.register_ptype(loader, ir) ⇒ Object



548
549
550
# File 'lib/puppet/pops/types/types.rb', line 548

def self.register_ptype(loader, ir)
  create_ptype(loader, ir, 'AnyType')
end

Instance Method Details

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


557
558
559
560
# File 'lib/puppet/pops/types/types.rb', line 557

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

#instance?(o, guard = nil) ⇒ Boolean

Returns:

  • (Boolean)


552
553
554
# File 'lib/puppet/pops/types/types.rb', line 552

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