Sha256: a8ca1ee3d4bfe35ee50a5970fab0c180073793fda1ad9966947f65a88626b552

Contents?: true

Size: 760 Bytes

Versions: 4

Compression:

Stored size: 760 Bytes

Contents

module SPNet

# Execute commands for a connected CommandInPort object.
#
# @author James Tunnell
class CommandOutPort < OutPort

  # A new instance of CommandOutPort.
  def initialize
    super(:matching_class => CommandInPort)
  end
  
  # If linked, return the result of calling the connected CommandInPort object's
  # list_commands method. Otherwise, return false.
  def list_commands
    unless @link.nil?
      return @link.to.list_commands
    end
    return false
  end

  # If linked, return the result of calling the connected CommandInPort object's
  # exec_command method. Otherwise, return false.
  def exec_command command, data = nil
    unless @link.nil?
      return @link.to.exec_command(command, data)
    end
    return false
  end

end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
spnet-0.1.8 lib/spnet/ports/command_out_port.rb
spnet-0.1.7 lib/spnet/ports/command_out_port.rb
spnet-0.1.6 lib/spnet/ports/command_out_port.rb
spnet-0.1.5 lib/spnet/ports/command_out_port.rb