Sha256: f2b8f59042d46abe5654ad5608695f50ae8f7a76cad74fd4ad487e0615742bf2

Contents?: true

Size: 390 Bytes

Versions: 5

Compression:

Stored size: 390 Bytes

Contents

module Battlesnake
  ##
  # Base class for "model" classes - _Game, Board, Snake, Location,_ etc.
  class Base
    ##
    # Whether both locations have the same coordinates.
    #
    # @param other [Location]
    #
    # @return [Boolean] true if location objects have the same coordinates.
    def ==(other)
      other.is_a?(self.class) && self.as_json == other.as_json
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
battlesnake-0.1.7 lib/battlesnake/base.rb
battlesnake-0.1.5 lib/battlesnake/base.rb
battlesnake-0.1.4 lib/battlesnake/base.rb
battlesnake-0.1.3 lib/battlesnake/base.rb
battlesnake-0.1.2 lib/battlesnake/base.rb