Class: Puppet::Pops::Types::PObjectType::PFunction

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

Overview

Describes a named Function in an Object type

Constant Summary

Constants included from Annotatable

Annotatable::TYPE_ANNOTATIONS

Instance Attribute Summary

Attributes inherited from PAnnotatedMember

#container, #name, #type

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from PAnnotatedMember

#==, #_pcore_init_hash, #accept, #assert_can_be_overridden, #assert_override, #constant?, #create_dispatch, #eql?, #feature_type, #final?, #hash, #invoke, label, #label, #override?

Methods included from Annotatable

#_pcore_init_hash, #annotatable_accept, #annotations, #init_annotatable

Constructor Details

#initialize(name, container, init_hash) ⇒ PFunction

Returns a new instance of PFunction.

Parameters:

  • name (String)

    The name of the attribute

  • container (PObjectType)

    The containing object type

  • init_hash (Hash{String=>Object})

    Hash containing function options



346
347
348
# File 'lib/puppet/pops/types/p_object_type.rb', line 346

def initialize(name, container, init_hash)
  super(name, container, TypeAsserter.assert_instance_of(["initializer for function '%s'", name], TYPE_FUNCTION, init_hash))
end

Class Method Details

.feature_typeObject

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.



355
356
357
# File 'lib/puppet/pops/types/p_object_type.rb', line 355

def self.feature_type
  'function'
end

Instance Method Details

#callable_typeObject



350
351
352
# File 'lib/puppet/pops/types/p_object_type.rb', line 350

def callable_type
  type
end