forked from OpenSHAPA/openshapa
-
Notifications
You must be signed in to change notification settings - Fork 21
Ruby Scripting Manual
Jesse Lingeman edited this page Aug 27, 2013
·
9 revisions
The Datavyu scripting API provides a scriptable interface to Datavyu's database, allowing you to manipulate your data, print in any format you'd like, or check your data for errors. Described in this guide are the classes and methods available to you, along with examples. A script repository is available where many example scripts can be found.
The database is broken into three different conceptual pieces: Variables, Cells, and Arguments. Variables represent each column in the Datavyu spreadsheet, Cells represent the cells within each column, and Arguments represent the values each cell contains (including the standard values of onset, offset, and ordinal).
-
-
RVariable (Ruby representation of Datavyu Variables)
- change_arg_name Change the name of the argument in the variable
- add_arg Add a new argument to a matrix variable
- remove_arg Remove an argument from a matrix variable
-
RCell (Ruby representation of Datavyu Cells)
- change_arg Change the value of a cell's argument
- print_all Return a string representing all of the cells' arguments
-
RVariable (Ruby representation of Datavyu Variables)
-
- getVariable Retrieve a variable from the database
- setVariable Write a variable back to the database
- createVariable Create a new variable
- deleteVariable Delete a variable from the database
- makeReliability Shortcut method for creating a reliability column
- createMutuallyExclusive Create a new column that is a combination of two others
- saveDB Save a database to a file
- loadDB Load a database from a file
- loadMacshapaDB Load a MacSHAPA database into Datavyu
- transferVariable Transfer a column from one database to another
- checkReliability Shortcut method to check reliability on a column
- checkValidCodes Shortcut method for checking for typos within codes
- getVariableList Get a list of the names of all of the columns in the database