Class: NullPosition

Inherits:
Object
  • Object
show all
Defined in:
lib/another_toy_robot/null_position.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeNullPosition

Returns a new instance of NullPosition.



4
5
6
7
8
# File 'lib/another_toy_robot/null_position.rb', line 4

def initialize
  @x_coord   = nil
  @y_coord   = nil
  @direction = nil
end

Instance Attribute Details

#directionObject (readonly)

Returns the value of attribute direction.



2
3
4
# File 'lib/another_toy_robot/null_position.rb', line 2

def direction
  @direction
end

#x_coordObject (readonly)

Returns the value of attribute x_coord.



2
3
4
# File 'lib/another_toy_robot/null_position.rb', line 2

def x_coord
  @x_coord
end

#y_coordObject (readonly)

Returns the value of attribute y_coord.



2
3
4
# File 'lib/another_toy_robot/null_position.rb', line 2

def y_coord
  @y_coord
end

Instance Method Details

#advanceObject



14
15
16
# File 'lib/another_toy_robot/null_position.rb', line 14

def advance
  self
end

#leftObject



18
19
20
# File 'lib/another_toy_robot/null_position.rb', line 18

def left
  self
end

#rightObject



22
23
24
# File 'lib/another_toy_robot/null_position.rb', line 22

def right
  self
end

#to_sObject



10
11
12
# File 'lib/another_toy_robot/null_position.rb', line 10

def to_s
  "No position"
end