Skip to content

Commit

Permalink
Spruce up readme
Browse files Browse the repository at this point in the history
  • Loading branch information
nesquena committed May 8, 2012
1 parent 755647a commit dc45548
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,21 @@

SheetMapper is about taking a google spreadsheet and converting a set of data rows into ruby objects.

## Installation

Setup in Gemfile:

```ruby
# Gemfile

gem 'sheet_mapper'
```

and then `require 'sheet_mapper'` and you are done!

## Usage

Define an object mapper:
First, define yourself an object mapper:

```ruby
class BubbleMapper < SheetMapper::Base
Expand All @@ -24,7 +36,8 @@ class BubbleMapper < SheetMapper::Base
end
```

Use a mapper:
This describes the column mappings and transformations to turn a spreadsheet row into a ruby object. Then you can use
a mapper within a worksheet collection:

```ruby
sheet = SheetMapper::Worksheet.new(:mapper => BubbleMapper, :key => 'sheet_key', :login => 'user', :password => 'pass')
Expand All @@ -35,4 +48,8 @@ bubbles = collection.each do |bubble|
end
```

You can then use these collections of objects and transform them into any format as needed.
You can then work with the objects within the collection and access their attributes.

## Contributors

SheetMapper was created by [Nathan Esquenazi](http://github.com/nesquena) at Miso in 2012.

0 comments on commit dc45548

Please sign in to comment.