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, #generalize, #instance?, #iterable?, #iterable_type, #kind_of_callable?, #name, #new_function, new_function, #normalize, #really_instance?, #resolve, simple_name, #simple_name, #to_alias_expanded_s, #to_s
_ptype, create_ptype, register_ptypes
Methods included from Visitable
#accept
#_ptype
Constructor Details
#initialize(type_name, title = nil) ⇒ PResourceType
Returns a new instance of PResourceType.
2992
2993
2994
2995
2996
|
# File 'lib/puppet/pops/types/types.rb', line 2992
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
2990
2991
2992
|
# File 'lib/puppet/pops/types/types.rb', line 2990
def downcased_name
@downcased_name
end
|
2990
2991
2992
|
# File 'lib/puppet/pops/types/types.rb', line 2990
def title
@title
end
|
#type_name ⇒ Object
2990
2991
2992
|
# File 'lib/puppet/pops/types/types.rb', line 2990
def type_name
@type_name
end
|
Class Method Details
.register_ptype(loader, ir) ⇒ Object
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
|
# File 'lib/puppet/pops/types/types.rb', line 2977
def self.register_ptype(loader, ir)
create_ptype(loader, ir, 'CatalogEntryType',
'type_name' => {
KEY_TYPE => POptionalType.new(PStringType::NON_EMPTY),
KEY_VALUE => nil
},
'title' => {
KEY_TYPE => POptionalType.new(PStringType::NON_EMPTY),
KEY_VALUE => nil
}
)
end
|
Instance Method Details
#eql?(o) ⇒ Boolean
2998
2999
3000
|
# File 'lib/puppet/pops/types/types.rb', line 2998
def eql?(o)
self.class == o.class && @downcased_name == o.downcased_name && @title == o.title
end
|
3002
3003
3004
|
# File 'lib/puppet/pops/types/types.rb', line 3002
def hash
@downcased_name.hash ^ @title.hash
end
|