Class: Battlesnake::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/battlesnake/base.rb

Overview

Base class for “model” classes - _Game, Board, Snake, Location,_ etc.

Direct Known Subclasses

Board, Game, Location, Snake

Instance Method Summary collapse

Instance Method Details

#==(other) ⇒ Boolean

Whether both locations have the same coordinates.

Parameters:

Returns:

  • (Boolean)

    true if location objects have the same coordinates.



11
12
13
# File 'lib/battlesnake/base.rb', line 11

def ==(other)
  other.is_a?(self.class) && self.as_json == other.as_json
end