Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add LICENSE and clarify readme

  • Loading branch information...
commit 264240b3150ced06034c30ed12fc84d2c8bb8fab 1 parent eb4bb0f
@nesquena authored
Showing with 42 additions and 5 deletions.
  1. +20 −0 LICENSE
  2. +22 −5 README.md
View
20 LICENSE
@@ -0,0 +1,20 @@
+Copyright (c) 2012 Nathan Esquenazi
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
View
27 README.md
@@ -16,7 +16,7 @@ and then `require 'sheet_mapper'` and you are done!
## Usage
-First, define yourself an object mapper:
+First, define an sheet object mapper:
```ruby
class SomeMapper < SheetMapper::Base
@@ -36,20 +36,37 @@ class SomeMapper < SheetMapper::Base
end
```
-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:
+The mapper describes the column mappings and transformations to turn a spreadsheet row into a ruby object. Then you can apply
+a mapper to any worksheet (collection):
```ruby
+# Login and access a particular spreadsheet by key
sheet = SheetMapper::Spreadsheet.new(:mapper => SomeMapper, :key => 'k', :login => 'u', :password => 'p')
+# Find a particular worksheet (collection) by title
collection = sheet.find_collection_by_title('title')
+# Iterate over the records within the worksheet
records = collection.each do |record|
p record.attributes
# => { :foo => "...", :bar => false, ... }
end
```
-You can then work with the objects within the collection and access their attributes.
+You can then work with the objects within the collection and access their attributes. You may also come across situations where you need access to 'meta' information associated with the collection. Use the 'cell' method to access arbitrary data points:
+
+```ruby
+# Accesses row 1, column 2 within the worksheet
+collection.cell(1, 2) => "foo"
+```
## Contributors
-SheetMapper was created by [Nathan Esquenazi](http://github.com/nesquena) at Miso in 2012.
+SheetMapper was created by [Nathan Esquenazi](http://github.com/nesquena) at Miso in 2012.
+
+## Tasks
+
+SheetMapper is a new gem and I would love submissions and patches. Particularly around allowing
+row data to be changed and then persisted back to the spreadsheet.
+
+## License
+
+Check `LICENSE` but of course feel free to use this in any projects.

0 comments on commit 264240b

Please sign in to comment.
Something went wrong with that request. Please try again.