Class: RobotsFindKitten::Robot
- Includes:
- DRb::DRbUndumped
- Defined in:
- lib/robotsfindkitten/robot.rb
Instance Attribute Summary collapse
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#on_find_kitten ⇒ Object
Returns the value of attribute on_find_kitten.
Attributes inherited from Thing
Instance Method Summary collapse
-
#initialize(server) ⇒ Robot
constructor
A new instance of Robot.
- #move_down ⇒ Object
- #move_left ⇒ Object
- #move_right ⇒ Object
- #move_up ⇒ Object
Constructor Details
#initialize(server) ⇒ Robot
Returns a new instance of Robot.
11 12 13 14 15 16 |
# File 'lib/robotsfindkitten/robot.rb', line 11 def initialize(server) super() @symbol = '#' @message = '' @server = server end |
Instance Attribute Details
#message ⇒ Object (readonly)
Returns the value of attribute message.
8 9 10 |
# File 'lib/robotsfindkitten/robot.rb', line 8 def @message end |
#on_find_kitten ⇒ Object
Returns the value of attribute on_find_kitten.
9 10 11 |
# File 'lib/robotsfindkitten/robot.rb', line 9 def on_find_kitten @on_find_kitten end |
Instance Method Details
#move_down ⇒ Object
22 23 24 |
# File 'lib/robotsfindkitten/robot.rb', line 22 def move_down move(0, 1) end |
#move_left ⇒ Object
26 27 28 |
# File 'lib/robotsfindkitten/robot.rb', line 26 def move_left move(-1, 0) end |
#move_right ⇒ Object
30 31 32 |
# File 'lib/robotsfindkitten/robot.rb', line 30 def move_right move(1, 0) end |
#move_up ⇒ Object
18 19 20 |
# File 'lib/robotsfindkitten/robot.rb', line 18 def move_up move(0, -1) end |