+ def contains?(other)
+ self.x < other.x and self.x + self.width > other.x + other.width and
+ self.y < other.y and self.y + self.height > other.y + other.height
+ end
+
+ def within?(other)
+ other.contains?(self)
+ end
+
+ def similarity(other)
+ 1.0 - self.name.edit_distance(other.name) / self.name.length.to_f
+ end
+