Class: Puppet::Pops::Types::PUnitType Private

Inherits:
PAnyType show all
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.

A type private to the type system that describes “ignored type” - i.e. “I am what you are”

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.

PUnitType.new

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from PAnyType

#==, #accept, #callable?, #callable_args?, #callable_with?, #check_self_recursion, #create, create, #eql?, #generalize, #hash, #iterable?, #iterable_type, #kind_of_callable?, #loader, #name, #new_function, #normalize, #really_instance?, #resolve, #roundtrip_with_string?, #simple_name, simple_name, #to_alias_expanded_s, #to_s

Methods inherited from TypedModelObject

_pcore_type, create_ptype, register_ptypes

Methods included from Visitable

#accept

Methods included from PuppetObject

#_pcore_all_contents, #_pcore_contents, #_pcore_init_hash, #_pcore_type, #to_s

Class Method Details

.new_function(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.

A “null” implementation - that simply returns the given argument


641
642
643
644
645
646
647
648
649
650
651
# File 'lib/puppet/pops/types/types.rb', line 641

def self.new_function(type)
  @new_function ||= Puppet::Functions.create_loaded_function(:new_unit, type.loader) do
    dispatch :from_args do
      param          'Any',  :from
    end

    def from_args(from)
      from
    end
  end
end

.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.


632
633
634
# File 'lib/puppet/pops/types/types.rb', line 632

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

Instance Method Details

#assignable?(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.


655
656
657
# File 'lib/puppet/pops/types/types.rb', line 655

def assignable?(o, guard=nil)
  true
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.


636
637
638
# File 'lib/puppet/pops/types/types.rb', line 636

def instance?(o, guard = nil)
  true
end