Class: NullPosition
- Inherits:
-
Object
- Object
- NullPosition
- Defined in:
- lib/another_toy_robot/null_position.rb
Instance Attribute Summary collapse
-
#direction ⇒ Object
readonly
Returns the value of attribute direction.
-
#x_coord ⇒ Object
readonly
Returns the value of attribute x_coord.
-
#y_coord ⇒ Object
readonly
Returns the value of attribute y_coord.
Instance Method Summary collapse
- #advance ⇒ Object
-
#initialize ⇒ NullPosition
constructor
A new instance of NullPosition.
- #left ⇒ Object
- #right ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize ⇒ NullPosition
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
#direction ⇒ Object (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_coord ⇒ Object (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_coord ⇒ Object (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
#advance ⇒ Object
14 15 16 |
# File 'lib/another_toy_robot/null_position.rb', line 14 def advance self end |
#left ⇒ Object
18 19 20 |
# File 'lib/another_toy_robot/null_position.rb', line 18 def left self end |
#right ⇒ Object
22 23 24 |
# File 'lib/another_toy_robot/null_position.rb', line 22 def right self end |
#to_s ⇒ Object
10 11 12 |
# File 'lib/another_toy_robot/null_position.rb', line 10 def to_s "No position" end |