I have a great number of methods like this:
def enableMotors
@posIface.Lock 1
@posIface.data.cmdEnableMotors = 1
@posIface.Unlock
end
def goTo (pos)
@posIface.Lock 1
@posIface.data.cmdVelocity.pos = pos
@posIface.Unlock
end
I would like to create functionality to :before_filter and :after_filter or any other way I can keep this code as DRY as possible. I dont want to depend on Rails or other heavy stuff only for this.