Skip to content

Commit f7a93bb

Browse files
committed
updated ruby script examples
1 parent 1f959a9 commit f7a93bb

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

RubyScript/rb/README.rdoc

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,24 @@ In this example cell 0 copies without changes and adds difference between cells
3636
$outContainer << Cells.new.int(row[0].to_i).double(row[1].to_f - row[2].to_f)
3737
end
3838

39+
40+
== Ruby Snippet examples
41+
Ruby snippet realizes as the body of a lambda-function in the following template:
42+
func = ->(row) do
43+
<<SNIPPET CODE>>
44+
end
45+
snippetRunner &func
46+
47+
=== Simple snippet examples
48+
Copy all rows without changes. Code may contains only row-variable.
49+
50+
row
51+
52+
Add difference between columns:
53+
54+
row << Cells.new.
55+
double(row[1].to_f - row[2].to_f)
56+
3957
== Other experiments
4058
Samples that add new cells in functional style.
4159
count = $inData0.length

0 commit comments

Comments
 (0)