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

#assignable?, #callable?, #callable_args?, #enumerable?, #generalize, #instance?, #kind_of_callable?, #simple_name, #to_s

Methods included from Visitable

#accept

Constructor Details

#initialize(type_name, title = nil) ⇒ PResourceType

Returns a new instance of PResourceType.



1479
1480
1481
1482
# File 'lib/puppet/pops/types/types.rb', line 1479

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

Instance Attribute Details

#titleObject (readonly)



1477
1478
1479
# File 'lib/puppet/pops/types/types.rb', line 1477

def title
  @title
end

#type_nameObject (readonly)



1477
1478
1479
# File 'lib/puppet/pops/types/types.rb', line 1477

def type_name
  @type_name
end

Instance Method Details

#==(o) ⇒ Object



1488
1489
1490
# File 'lib/puppet/pops/types/types.rb', line 1488

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

#hashObject



1484
1485
1486
# File 'lib/puppet/pops/types/types.rb', line 1484

def hash
  @type_name.hash * 31 + @title.hash
end