<commit_before>module RoverControl
  class Rover

    def initialize(rover_position, x_limit, y_limit)
      @position = PositionController.new(rover_position.split(' '), x_limit, y_limit)
    end

  end

end<commit_msg>added process_commands method returning the position after executed<commit_after>module RoverControl
  class Rover

    def initialize(rover_position, x_limit, y_limit)
      @position = PositionController.new(rover_position.split(' '), x_limit, y_limit)
    end

    def process_commands(commands)
      commands.chars.each do |command|
        if command == 'M'
          @position.move
        elsif %w(R L).include?(command)
          @position.turn(command)
        else
          raise InvalidCommandError
        end
      end

      current_position
    end

    def current_position
      @position.to_s
    end

  end
end
{'fraction_non_alphanumeric': 0.07403055229142186, 'fraction_numerical': 0.0, 'mean_word_length': 2.8552036199095023, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7430224', 'n_tokens_mistral': 255, 'n_tokens_neox': 248, 'n_words': 60}