diff options
| author | mo k <mo@mokhan.ca> | 2012-02-12 14:32:21 -0700 |
|---|---|---|
| committer | mo k <mo@mokhan.ca> | 2012-02-12 14:32:21 -0700 |
| commit | f5ef080a6094062ba06235fbcf63884ed6f88039 (patch) | |
| tree | 3b1ec55e2cd55b03e8a0dd37755d33474c6dbcd0 | |
| parent | ae2e14fd5b02bb495be0a270aae7235a14ba67fe (diff) | |
remove to_sym from each heading.
| -rw-r--r-- | lib/rover.rb | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/lib/rover.rb b/lib/rover.rb index 8b992e9..ec1356f 100644 --- a/lib/rover.rb +++ b/lib/rover.rb @@ -5,7 +5,7 @@ class Rover @location = coordinates end def heading - @heading.to_sym + @heading.class.name.downcase.to_sym end def turn_right @heading = @heading.turn_right @@ -19,9 +19,6 @@ class Rover end class North - def to_sym - :north - end def turn_right East.new end @@ -33,9 +30,6 @@ class North end end class East - def to_sym - :east - end def turn_right South.new end @@ -47,9 +41,6 @@ class East end end class West - def to_sym - :west - end def turn_right North.new end @@ -61,9 +52,6 @@ class West end end class South - def to_sym - :south - end def turn_right West.new end |
