RColumn Class

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 changes newcell's onset to 1000ms using change_code() and writes the change back to the spreadsheet using set_column().

trial = get_column("trial")
newcell = trial.make_new_cell()
newcell.change_code("onset", 1000)
set_column("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 = get_column("trial")
   trial.change_code_name("bad_code_name", "awesome_code_name")
   set_column("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 set_column().

require 'Datavyu_API.rb'
begin
   trial = get_column("trial")
   trial.add_code("unit")
   set_column(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.

Example

The following example removes the unit code from the “trial” column and then writes the changes back to the spreadsheet using set_column().

require 'Datavyu_API.rb'
begin
   trial = get_column("trial")
   trial.remove_code("unit")
   set_column(trial)
end