Skip to content

Commit 2ab61bc

Browse files
committed
added comments about how to create cells
1 parent 3e5ebd8 commit 2ab61bc

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

RubyScript/src/org/knime/ext/jruby/RubyScriptNodeModel.java

+7
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,11 @@ protected RubyScriptNodeModel(int inNumInputs, int inNumOutputs, boolean snippet
144144
buffer.append("# Flow variables:\n");
145145
buffer.append("# puts FlowVariableList['knime.workspace'] # reading \n");
146146
buffer.append("# FlowVariableList['filename'] = '1.txt' # writing \n");
147+
buffer.append("#\n");
148+
149+
buffer.append("# Cells creation is available in old style with #string(), #int(), #double() methods\n");
150+
buffer.append("# or in KNIME style:\n");
151+
buffer.append("# Cell.new.StringCell('str').IntegerCell(123).LongCell(2345).DoubleCell(1.2)\n");
147152
buffer.append("#\n#\n");
148153

149154
if (m_snippetMode) {
@@ -154,6 +159,8 @@ protected RubyScriptNodeModel(int inNumInputs, int inNumOutputs, boolean snippet
154159
+ "# Example script. "
155160
+ "Add new two columns with String and Int types from current row:\n"
156161
+ "# row << (Cells.new.string('Hi!').int(row.getCell(0).to_s.length))\n"
162+
+ "# Or just create new cells if you don't want to combine them with existing ones:\n"
163+
+ "# Cells.new.string('Hi!').int(row.getCell(0).to_s.length)\n"
157164
+ "#\n");
158165

159166
buffer.append("# Default snippet (copy existing row):\n");

0 commit comments

Comments
 (0)