aboutsummaryrefslogtreecommitdiffstats
path: root/lib/tom_tom/matrix/point.rb
blob: 4e9d11e682d343a1adcccea24a05035c45174e73 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
module TomTom
  class Matrix
    class Point
      attr_reader :coordinates, :id

      def initialize(coordinates, id)
        @coordinates = coordinates
        @id = id
      end

      def ==(other)
        other.is_a?(self.class) &&
          @coordinates == other.coordinates &&
          @id == other.id
      end

      alias :eql? :==

      def hash
        @coordinates.hash + @id.hash
      end
    end
  end
end