File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -104,20 +104,23 @@ def [](idx)
104104
105105 # Generate dynamic methods for accessing to cells by column name
106106 # from BlobSupportDataRow.
107- # All names are translated in low case. All symbols except :word: are
108- # changed to underline symbol.
107+ # All symbols except :word: are changed to underline symbol.
108+ # For all names is created a pair of normal and downcased name.
109109 # For input 0 only is generated simple names. For all inputs methods has
110110 # a following format: i#{input_num}_translated_column_name
111111 #
112112 $num_inputs ||= 0
113113 ( 0 ...$num_inputs) . each do |i |
114114 table = $input_datatable_arr[ i ]
115115 col_names = table . getDataTableSpec . getColumnNames . map do |str |
116- str . downcase . gsub ( /[^[[:word:]]]/ , '_' ) . gsub ( /\_ +/ , '_' ) . chomp ( '_' )
116+ [ ( s1 = str . gsub ( /[^[[:word:]]]/ , '_' ) . gsub ( /\_ +/ , '_' ) . chomp ( '_' ) ) ,
117+ s1 . downcase ] . uniq
117118 end
118- col_names . each_with_index do |name , num |
119- define_method ( name ) { getCell ( num ) } if i == 0
120- define_method ( "i#{ i } _#{ name } " ) { getCell ( num ) }
119+ col_names . each_with_index do |names , num |
120+ names . each do |name |
121+ define_method ( name ) { getCell ( num ) } if i == 0
122+ define_method ( "i#{ i } _#{ name } " ) { getCell ( num ) }
123+ end
121124 end
122125 end
123126 end
You can’t perform that action at this time.
0 commit comments