A name/type combination that can be used as a compound hash key
True if name is qualified (more than a single segment)
# File lib/puppet/pops/loader/loader.rb, line 169 def ==(o) o.class == self.class && type == o.type && name == o.name end
# File lib/puppet/pops/loader/loader.rb, line 165 def hash @hash end
# File lib/puppet/pops/loader/loader.rb, line 175 def to_s "#{type}/#{name}" end
# File lib/puppet/pops/loader/loader.rb, line 147 def initialize(type, name) @type = type # relativize the name (get rid of leading ::), and make the split string available @name_parts = name.to_s.split(/::/) @name_parts.shift if name_parts[0].empty? @name = name_parts.join('::') @qualified = name_parts.size > 1 # precompute hash - the name is frozen, so this is safe to do @hash = [self.class, type, @name].hash # Not allowed to have numeric names - 0, 010, 0x10, 1.2 etc if Puppet::Pops::Utils.is_numeric?(@name) raise ArgumentError, "Illegal attempt to use a numeric name '#{name}' at #{origin_label(origin)}." end freeze() end