class T2Server::InputPort

Represents an input to a workflow.

Attributes

file[R]

If set, the file which has been used to supply this port’s data.

value[R]

If set, the value held by this port. Could be a list (of lists (etc)).

Public Instance Methods

baclava? → true or false click to toggle source

Has this port been set via a baclava document?

# File lib/t2-server/port.rb, line 145
def baclava?
  @run.baclava_input?
end
file = filename click to toggle source

Set the file to use for this port’s data. The file will be uploaded to the server before the run starts. This has no effect if the run is already running or finished.

# File lib/t2-server/port.rb, line 134
def file=(filename)
  return unless @run.initialized?
  @value = nil
  @file = filename
  @remote_file = false
end
file? → true or false click to toggle source

Is this port’s data being supplied by a file? The file could be local or remote (already on the server) for this to return true.

# File lib/t2-server/port.rb, line 102
def file?
  !@file.nil?
end
remote_file = filename click to toggle source

Set the remote file to use for this port’s data. The file must already be on the server. This has no effect if the run is already running or finished.

# File lib/t2-server/port.rb, line 121
def remote_file=(filename)
  return unless @run.initialized?
  @value = nil
  @file = filename
  @remote_file = true
end
remote_file? → true or false click to toggle source

Is this port’s data being supplied by a remote (one that is already on the server) file?

# File lib/t2-server/port.rb, line 111
def remote_file?
  file? && @remote_file
end
set? → true or false click to toggle source

Has this port been set?

# File lib/t2-server/port.rb, line 153
def set?
  !value.nil? || file? || baclava?
end
value = value click to toggle source

Set the value of this input port. This has no effect if the run is already running or finished.

# File lib/t2-server/port.rb, line 90
def value=(value)
  return unless @run.initialized?
  @file = nil
  @remote_file = false
  @value = value
end