Class: TurtleProxy

Inherits:
Object
  • Object
show all
Defined in:
lib/kame/remocon/turtle_proxy.rb

Instance Method Summary collapse

Constructor Details

#initialize(turtle) ⇒ TurtleProxy

Returns a new instance of TurtleProxy.



2
3
4
# File 'lib/kame/remocon/turtle_proxy.rb', line 2

def initialize(turtle)
  @turtle = DRb::DRbObject.new(turtle)
end

Instance Method Details

#backward(dist) ⇒ Object



44
45
46
# File 'lib/kame/remocon/turtle_proxy.rb', line 44

def backward(dist)
  @turtle.backward(dist)
end

#clearObject



12
13
14
# File 'lib/kame/remocon/turtle_proxy.rb', line 12

def clear
  @turtle.clear
end

#color(color) ⇒ Object



36
37
38
# File 'lib/kame/remocon/turtle_proxy.rb', line 36

def color(color)
  @turtle.color(color)
end

#exec(&block) ⇒ Object



6
7
8
9
10
# File 'lib/kame/remocon/turtle_proxy.rb', line 6

def exec(&block)
  @turtle.clear
  @turtle.reset
  self.instance_eval &block
end

#forward(dist) ⇒ Object



40
41
42
# File 'lib/kame/remocon/turtle_proxy.rb', line 40

def forward(dist)
  @turtle.forward(dist)
end

#move_to(x, y) ⇒ Object



48
49
50
# File 'lib/kame/remocon/turtle_proxy.rb', line 48

def move_to(x,y)
  @turtle.move_to(x, y)
end

#pen_downObject



28
29
30
# File 'lib/kame/remocon/turtle_proxy.rb', line 28

def pen_down
  @turtle.pen_down
end

#pen_upObject



32
33
34
# File 'lib/kame/remocon/turtle_proxy.rb', line 32

def pen_up
  @turtle.pen_up
end

#resetObject



16
17
18
# File 'lib/kame/remocon/turtle_proxy.rb', line 16

def reset
  @turtle.reset
end

#turn_left(digree) ⇒ Object



20
21
22
# File 'lib/kame/remocon/turtle_proxy.rb', line 20

def turn_left(digree)
  @turtle.turn_left(digree)
end

#turn_right(digree) ⇒ Object



24
25
26
# File 'lib/kame/remocon/turtle_proxy.rb', line 24

def turn_right(digree)
  @turtle.turn_right(digree)
end