Class: RoboticArm::ComponentMoving
Instance Method Summary
collapse
Methods inherited from Component
#active?
Constructor Details
Returns a new instance of ComponentMoving.
229
230
231
232
233
|
# File 'lib/robotic-arm.rb', line 229
def initialize(robot_arm)
super(robot_arm)
@switch, @val = 0, OFF
@moving = false
end
|
Instance Method Details
#moving? ⇒ Boolean
242
|
# File 'lib/robotic-arm.rb', line 242
def moving?() @active ? @moving : false end
|
#stop ⇒ Object
235
236
237
238
239
240
|
# File 'lib/robotic-arm.rb', line 235
def stop()
if moving? then
@active = false
activate(@switch, -(@prev_val))
end
end
|