Class: Puppet::Pops::Types::PClassType

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

Overview

Represents a (host-) class in the Puppet Language.

Constant Summary collapse

DEFAULT =
PClassType.new(nil)

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from PCatalogEntryType

#instance?

Methods inherited from PAnyType

#==, #accept, #assignable?, #callable?, #callable_args?, #callable_with?, #check_self_recursion, create, #create, #generalize, #instance?, #iterable?, #iterable_type, #kind_of_callable?, #loader, #name, new_function, #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

Constructor Details

#initialize(class_name) ⇒ PClassType

Returns a new instance of PClassType.



3187
3188
3189
# File 'lib/puppet/pops/types/types.rb', line 3187

def initialize(class_name)
  @class_name = class_name
end

Instance Attribute Details

#class_nameObject (readonly)



3177
3178
3179
# File 'lib/puppet/pops/types/types.rb', line 3177

def class_name
  @class_name
end

Class Method Details

.register_ptype(loader, ir) ⇒ Object



3179
3180
3181
3182
3183
3184
3185
# File 'lib/puppet/pops/types/types.rb', line 3179

def self.register_ptype(loader, ir)
  create_ptype(loader, ir, 'CatalogEntryType',
               'class_name' => {
                 KEY_TYPE => POptionalType.new(PStringType::NON_EMPTY),
                 KEY_VALUE => nil
               })
end

Instance Method Details

#eql?(o) ⇒ Boolean

Returns:

  • (Boolean)


3195
3196
3197
# File 'lib/puppet/pops/types/types.rb', line 3195

def eql?(o)
  self.class == o.class && @class_name == o.class_name
end

#hashObject



3191
3192
3193
# File 'lib/puppet/pops/types/types.rb', line 3191

def hash
  11 ^ @class_name.hash
end