lib/polymer/sprite.rb in polymer-1.0.0.beta.5 vs lib/polymer/sprite.rb in polymer-1.0.0.beta.6
- old
+ new
@@ -78,9 +78,17 @@
#
def digest
Digest::SHA256.hexdigest(sources.map { |source| source.digest }.join)
end
+ # A sprite is equal to another sprite if the names are the same.
+ #
+ # @return [Boolean]
+ #
+ def ==(other)
+ other.respond_to?(:name) and other.name == name
+ end
+
# Saves the composited sprite to disk.
#
# In the event that the sprite has no sources, +save+ will return false
# and the existing file will be left untouched.
#