def do(action)
      raise ArgumentError, "Parameter, 'action', expected to be a #{Action}, but received: #{action}" unless action.is_a? Action

      # Remove all undone actions when a new one is performed.
      if can_redo?
        if @last_done == -1
          @actions.clear
        else
          @actions = @actions[0..@last_done]
        end
      end

      # If history is too big, remove the oldest action.
      if @actions.size >= @max_size
        @actions.shift
      end

      @last_done = @actions.size
      @actions << action
      action.do

      nil
    end
def do(action)
      raise ArgumentError, "Parameter, 'action', expected to be a #{Action}, but received: #{action}" unless action.is_a? Action

      # Remove all undone actions when a new one is performed.
      if can_redo?
        if @last_done == -1
          @actions.clear
        else
          @actions = @actions[0..@last_done]
        end
      end

      # If history is too big, remove the oldest action.
      if @actions.size >= @max_size
        @actions.shift
      end

      @last_done = @actions.size
      @actions << action
      action.do

      nil
    end
Perform a History::Action, adding it to the history.
 If there are currently any actions that have been undone, they will be permanently lost and cannot be redone.

 @param [History::Action] action Action to be performed