Class: Puppet::Pops::Types::PResourceType
Overview
Represents a Resource Type in the Puppet Language
Constant Summary
collapse
- DEFAULT =
PResourceType.new(nil)
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
#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
_pcore_type, create_ptype, register_ptypes
Methods included from Visitable
#accept
#_pcore_all_contents, #_pcore_contents, #_pcore_init_hash, #_pcore_type, #to_s
Constructor Details
#initialize(type_name, title = nil) ⇒ PResourceType
Returns a new instance of PResourceType.
3235
3236
3237
3238
3239
|
# File 'lib/puppet/pops/types/types.rb', line 3235
def initialize(type_name, title = nil)
@type_name = type_name.freeze
@title = title.freeze
@downcased_name = type_name.nil? ? nil : @type_name.downcase.freeze
end
|
Instance Attribute Details
#downcased_name ⇒ Object
3233
3234
3235
|
# File 'lib/puppet/pops/types/types.rb', line 3233
def downcased_name
@downcased_name
end
|
3233
3234
3235
|
# File 'lib/puppet/pops/types/types.rb', line 3233
def title
@title
end
|
#type_name ⇒ Object
3233
3234
3235
|
# File 'lib/puppet/pops/types/types.rb', line 3233
def type_name
@type_name
end
|
Class Method Details
.register_ptype(loader, ir) ⇒ Object
Instance Method Details
#eql?(o) ⇒ Boolean
3241
3242
3243
|
# File 'lib/puppet/pops/types/types.rb', line 3241
def eql?(o)
self.class == o.class && @downcased_name == o.downcased_name && @title == o.title
end
|
3245
3246
3247
|
# File 'lib/puppet/pops/types/types.rb', line 3245
def hash
@downcased_name.hash ^ @title.hash
end
|