Skip to content

Commit

Permalink
* Refactor.
Browse files Browse the repository at this point in the history
  • Loading branch information
ledestin committed Apr 2, 2014
1 parent eec8c38 commit 9e1839b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions direction.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,6 @@ def self.Direction direction
WEST = Direction 'WEST'
ALL = [NORTH, EAST, SOUTH, WEST].map! { |d| d.freeze }

Kernel.class_eval <<-EOF
def Direction direction
Direction::Direction direction
end
EOF

def next
case self
when NORTH then EAST
Expand Down Expand Up @@ -48,3 +42,9 @@ def prev!
end
end
end

module Kernel
def Direction direction
Robot::Direction::Direction direction
end
end

0 comments on commit 9e1839b

Please sign in to comment.