Class: RoboticArm::ComponentMoving

Inherits:
Component
  • Object
show all
Defined in:
lib/robotic-arm.rb

Direct Known Subclasses

Base, ComponentUpDown, Gripper

Instance Method Summary collapse

Methods inherited from Component

#active?

Constructor Details

#initialize(robot_arm) ⇒ ComponentMoving

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

Returns:

  • (Boolean)


242
# File 'lib/robotic-arm.rb', line 242

def moving?() @active ? @moving : false  end

#stopObject



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