Sha256: 89e63598047e9b3bb4b3340f62cd4a7f9e0b96ec4da53a05f72a7d586a400c01

Contents?: true

Size: 394 Bytes

Versions: 4

Compression:

Stored size: 394 Bytes

Contents

# frozen_string_literal: true

module Robot
  module Commands
    # A no operation command that gets returned to avoid nil exceptions when the command the user
    # enters is invalid. The idea is based on the null pointer design pattern

    class NoOp < Base
      def self.matches?(_command)
        true
      end

      def self.call(position)
        position
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
robot_rea-0.1.9 lib/robot/commands/no_op.rb
robot_rea-0.1.8 lib/robot/commands/no_op.rb
robot_rea-0.1.7 lib/robot/commands/no_op.rb
robot_rea-0.1.6 lib/robot/commands/no_op.rb