Exception: InvalidMoveException

Inherits:
StandardError
  • Object
show all
Defined in:
lib/software_challenge_client/invalid_move_exception.rb

Overview

Exception indicating a move which was performed is not valid for the given state.

Instance Method Summary collapse

Constructor Details

#initialize(msg, move_or_action) ⇒ InvalidMoveException

Returns a new instance of InvalidMoveException.



6
7
8
9
10
11
# File 'lib/software_challenge_client/invalid_move_exception.rb', line 6

def initialize(msg, move_or_action)
  # This exception will be thrown by a move or by an individual action,
  # depending where the rule violation was detected.
  @move_or_action = move_or_action
  super(msg)
end

Instance Method Details

#messageObject



13
14
15
# File 'lib/software_challenge_client/invalid_move_exception.rb', line 13

def message
  "#{super}: #{@move_or_action}"
end