Skip to content

Commit 2526f08

Browse files
committed
README: added description about access methods to cells
1 parent 3d9dc55 commit 2526f08

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

RubyScript/rb/README.rdoc

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,26 @@ Add difference between columns:
5454
row << Cells.new.
5555
double(row[1].to_f - row[2].to_f)
5656

57+
== Access to cells of the input row
58+
59+
Now is realized an access to cells of the row by indexes and by names.
60+
E.g. we have a table with following columns 'x', 'Y1', 'Y2', 'y1(1)', 'y2(1)'.
61+
We can access by indexes from 0 to 4 or from -1 (last column) to -5 (first column).
62+
For these names a special methods are generated. All names are translated in low case.
63+
All symbols except alhabetic and numbers are changed to underline symbol. Multiple
64+
undeline symbols are changed by a single. Last one is deleted. That is we have a following
65+
set of methods: #x, #y1, #y2, #y1_1, #y2_1 available for instances of
66+
BlobSupportDataRow class. Following code fragments are available:
67+
68+
row << Cells.new.double(row[0].to_f)
69+
double(row.y1.to_f - row.y2.to_f)
70+
71+
and
72+
73+
$inData0.each do |row|
74+
$outContainer << Cells.new.string(row.x.to_s)
75+
end
76+
5777
== Other experiments
5878
Samples that add new cells in functional style.
5979
count = $inData0.length

0 commit comments

Comments
 (0)