Commit e2d6573
Changed files (5)
lib/filtered_command.rb
@@ -1,10 +0,0 @@
-class FilteredCommand
- def initialize(command, specification)
- @command = command
- @specification = specification
- end
- def run(item)
- @command.run if @specification.matches(item)
- end
-end
-
lib/move_forward.rb
@@ -1,8 +0,0 @@
-class MoveForward
- def initialize(rover)
- @rover = rover
- end
- def run
- @rover.drive
- end
-end
lib/specification.rb
@@ -1,8 +0,0 @@
-class Specification
- def initialize(criteria)
- @criteria = criteria
- end
- def matches(item)
- @criteria.call(item)
- end
-end
lib/turn_left.rb
@@ -1,8 +0,0 @@
-class TurnLeft
- def initialize(rover)
- @rover = rover
- end
- def run
- @rover.rotate(-90)
- end
-end
lib/turn_right.rb
@@ -1,8 +0,0 @@
-class TurnRight
- def initialize(rover)
- @rover = rover
- end
- def run
- @rover.rotate(90)
- end
-end