class Commander

Constants

METHODS

Attributes

commands[R]

Public Class Methods

new(forward = nil) click to toggle source
# File lib/kame/remocon/commander.rb, line 6
def initialize(forward = nil)
  if forward
    @forward = forward
  else
    @commands = []
  end
end

Public Instance Methods

<<(command) click to toggle source
# File lib/kame/remocon/commander.rb, line 14
def <<(command)
  if @forward
    @forward.method(command.first).call(*command[1..-1])
  else
    @commands << command
  end
end
backward(dist) click to toggle source
# File lib/kame/remocon/commander.rb, line 54
def backward(dist)
  self << [:forward, -dist]
end
clear() click to toggle source
# File lib/kame/remocon/commander.rb, line 22
def clear
  self << [:clear]
end
color(color) click to toggle source
# File lib/kame/remocon/commander.rb, line 46
def color(color)
  self << [:color, color]
end
forward(dist) click to toggle source
# File lib/kame/remocon/commander.rb, line 50
def forward(dist)
  self << [:forward, dist]
end
move_to(x, y) click to toggle source
# File lib/kame/remocon/commander.rb, line 58
def move_to(x, y)
  self << [:move_to, x, y]
end
pen_down() click to toggle source
# File lib/kame/remocon/commander.rb, line 38
def pen_down
  self << [:pen_down]
end
pen_up() click to toggle source
# File lib/kame/remocon/commander.rb, line 42
def pen_up
  self << [:pen_up]
end
reset() click to toggle source
# File lib/kame/remocon/commander.rb, line 26
def reset
  self << [:reset]
end
turn_left(digree) click to toggle source
# File lib/kame/remocon/commander.rb, line 30
def turn_left(digree)
  self << [:turn_left, digree]
end
turn_right(digree) click to toggle source
# File lib/kame/remocon/commander.rb, line 34
def turn_right(digree)
  self << [:turn_right, digree]
end