module NXT::Connector::Output

Holds implementations of connectors that are output based.

Holds implementations of connectors that are output based.

Private Instance Methods

duration_after=(after) click to toggle source
# File lib/nxt/connector/output/motor.rb, line 97
def duration_after=(after)
  if after.nil?
    @duration_after = :stop
  else
    unless @duration_type == :seconds
      raise(TypeError, 'The after option is only available when the unit duration is in seconds.')
    end

    assert_in(:after, after, DURATION_AFTER)
    @duration_after = after
  end
end
duration_type=(type) click to toggle source
# File lib/nxt/connector/output/motor.rb, line 88
def duration_type=(type)
  if type.nil?
    @duration_type = :seconds
  else
    assert_in(:type, type, DURATION_TYPE)
    @duration_type = type
  end
end
wait_after_move() click to toggle source
# File lib/nxt/connector/output/motor.rb, line 110
def wait_after_move
  sleep(duration)
  reset
  stop(duration_after)
end