lib/sitehub/identifier.rb in sitehub-0.5.0.alpha4 vs lib/sitehub/identifier.rb in sitehub-0.5.0.alpha5
- old
+ new
@@ -9,11 +9,11 @@
def child_label(label)
components.empty? ? label : "#{self}|#{label}"
end
def root
- components.first
+ Identifier.new(components.first)
end
def sub_id
Identifier.new(components[1..-1].join('|'))
end
@@ -31,7 +31,13 @@
end
def ==(other)
other.respond_to?(:to_sym) && to_sym == other.to_sym
end
+
+ def hash
+ components.hash
+ end
+
+ alias eql? ==
end
end