Class: T2Server::InputPort
Overview
Represents an input to a workflow.
Instance Attribute Summary collapse
-
#file ⇒ Object
If set, the file which has been used to supply this port’s data.
-
#value ⇒ Object
If set, the value held by this port.
Attributes inherited from Port
Instance Method Summary collapse
-
#baclava? ⇒ Boolean
:call-seq: baclava? -> true or false.
-
#file? ⇒ Boolean
:call-seq: file? -> true or false.
-
#initialize(run, xml) ⇒ InputPort
constructor
:stopdoc: Create a new InputPort.
-
#remote_file=(filename) ⇒ Object
:call-seq: remote_file = filename.
-
#remote_file? ⇒ Boolean
:call-seq: remote_file? -> true or false.
-
#set? ⇒ Boolean
:call-seq: set? -> true or false.
Methods included from XML::Methods
#get_uris_from_doc, #xml_children, #xml_document, #xml_first_child, #xml_node_attribute, #xml_node_content, #xml_node_name, #xml_text_node, #xpath_attr, #xpath_compile, #xpath_find, #xpath_first
Constructor Details
#initialize(run, xml) ⇒ InputPort
:stopdoc: Create a new InputPort.
76 77 78 79 80 81 82 |
# File 'lib/t2-server/port.rb', line 76 def initialize(run, xml) super(run, xml) @value = nil @file = nil @remote_file = false end |
Instance Attribute Details
#file ⇒ Object
If set, the file which has been used to supply this port’s data.
69 70 71 |
# File 'lib/t2-server/port.rb', line 69 def file @file end |
#value ⇒ Object
If set, the value held by this port. Could be a list (of lists (etc)).
72 73 74 |
# File 'lib/t2-server/port.rb', line 72 def value @value end |
Instance Method Details
#baclava? ⇒ Boolean
:call-seq:
baclava? -> true or false
Has this port been set via a baclava document?
145 146 147 |
# File 'lib/t2-server/port.rb', line 145 def baclava? @run.baclava_input? end |
#file? ⇒ Boolean
:call-seq:
file? -> true or false
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.
102 103 104 |
# File 'lib/t2-server/port.rb', line 102 def file? !@file.nil? end |
#remote_file=(filename) ⇒ Object
:call-seq:
remote_file = filename
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.
121 122 123 124 125 126 |
# 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? ⇒ Boolean
:call-seq:
remote_file? -> true or false
Is this port’s data being supplied by a remote (one that is already on the server) file?
111 112 113 |
# File 'lib/t2-server/port.rb', line 111 def remote_file? file? && @remote_file end |
#set? ⇒ Boolean
:call-seq:
set? -> true or false
Has this port been set?
153 154 155 |
# File 'lib/t2-server/port.rb', line 153 def set? !value.nil? || file? || baclava? end |