Skip to content

Commit

Permalink
Basic guide
Browse files Browse the repository at this point in the history
  • Loading branch information
gorn committed Sep 30, 2015
1 parent a19b2c2 commit cd133c9
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions GUIDE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,33 @@
## Guide to basic functionality
### Opening the file

You can open ODS file like this
````ruby
@workbook = Rspreadsheet.open('./test.ods')
````
and access its first sheet like this
````ruby
@sheet = @workbook.worksheets(1)
````
### Accessing cells

you can get and set contents of cells using "verbatim" syntax like
````ruby
@sheet.rows(5).cells(4).value
@sheet.rows(5).cells(4).value = 10
````
or using "brief" syntax like
````ruby
@sheet[5,4]
@sheet[5,4] = 10
````

You can mix these two at will, for example like this
````ruby
@row = @sheet.rows(5)
@row[4] = 10
````

## Examples

* [basic functionality](https://gist.github.com/gorn/42e33d086d9b4fda10ec)
Expand Down

0 comments on commit cd133c9

Please sign in to comment.