Class: Puppet::Pops::Types::PResourceType

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

Overview

Represents a Resource Type in the Puppet Language

Constant Summary collapse

DEFAULT =
PResourceType.new(nil)

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from PCatalogEntryType

#instance?

Methods inherited from PAnyType

#==, #accept, #assignable?, #callable?, #callable_args?, #generalize, #instance?, #iterable?, #iterable_type, #kind_of_callable?, #normalize, #simple_name, #to_alias_expanded_s, #to_s

Methods included from Visitable

#accept

Constructor Details

#initialize(type_name, title = nil) ⇒ PResourceType

Returns a new instance of PResourceType.



2121
2122
2123
2124
# File 'lib/puppet/pops/types/types.rb', line 2121

def initialize(type_name, title = nil)
  @type_name = type_name
  @title = title
end

Instance Attribute Details

#titleObject (readonly)



2119
2120
2121
# File 'lib/puppet/pops/types/types.rb', line 2119

def title
  @title
end

#type_nameObject (readonly)



2119
2120
2121
# File 'lib/puppet/pops/types/types.rb', line 2119

def type_name
  @type_name
end

Instance Method Details

#eql?(o) ⇒ Boolean

Returns:

  • (Boolean)


2130
2131
2132
# File 'lib/puppet/pops/types/types.rb', line 2130

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

#hashObject



2126
2127
2128
# File 'lib/puppet/pops/types/types.rb', line 2126

def hash
  @type_name.hash ^ @title.hash
end