This repository has been archived by the owner on Aug 30, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
Ruby Scripting Manual
smidget edited this page Jul 25, 2012
·
7 revisions
The OpenSHAPA scripting API provides a scriptable interface to OpenSHAPA'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 OpenSHAPA 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 OpenSHAPA 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 OpenSHAPA 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 OpenSHAPA 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 OpenSHAPA
- 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
- getColumnList Get a list of the names of all of the columns in the database