RColumn Class¶
- class RColumn¶
The Ruby container for Datavyu columns.
- classmethod make_new_cell()¶
Creates a new blank cell at the end of the column’s cell array.
Argument
Type
Description
None
Returns
Reference to the cell that was just created. Modify the cell using this reference.
Example
The following example creates a new cell at the end of the “trial” column’s cell array and assigns its reference to the variable
newcell
. It then changesnewcell's
onset to 1000ms usingchange_code()
and writes the change back to the spreadsheet usingsetColumn()
.trial = getColumn("trial") newcell = trial.make_new_cell() newcell.change_code("onset", 1000) setColumn("trial", trial)
- classmethod change_code_name(old_name, new_name)¶
Renames a code.
Argument
Type
Description
old_name
String
Current name of the code
new_name
String
New name for the code, which will replace
old_name
Returns
Nothing.
Example
The following example renames the “trial” column’s bad_code_name code to awesome_code_name and then writes the changes back to the Datavyu spreadsheet:
require 'Datavyu_API.rb' begin trial = getColumn("trial") trial.change_code_name("bad_code_name", "awesome_code_name") setColumn("trial", trial) end
- classmethod add_code(name)¶
Adds a code to a column.
Argument
Type
Description
name
String
The name of the code you are adding to the column
Returns
Nothing.
Example
The following example adds the unit code to the “trial” column and then writes the changes back to the spreadsheet using
setColumn()
.require 'Datavyu_API.rb' begin trial = getColumn("trial") trial.add_code("unit") setColumn(trial) end
- classmethod remove_code(name)¶
Deletes a code from a column.
Argument
Type
Description
name
String
The name of the code you wish to delete from the column
Returns
Nothing.