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? → bool click to toggle source

Has this port been set via a baclava document?

# File lib/t2-server/port.rb, line 141
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 130
def file=(filename)
  return unless @run.initialized?
  @value = nil
  @file = filename
  @remote_file = false
end
file? → bool 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 98
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 117
def remote_file=(filename)
  return unless @run.initialized?
  @value = nil
  @file = filename
  @remote_file = true
end
remote_file? → bool 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 107
def remote_file?
  file? && @remote_file
end
set? → bool click to toggle source

Has this port been set?

# File lib/t2-server/port.rb, line 149
def set?
  !value.nil? or file? or 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 86
def value=(value)
  return unless @run.initialized?
  @file = nil
  @remote_file = false
  @value = value
end