Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/elifoster/oocsv-rb

A very dynamic object-oriented approach to CSV reading and writing.
https://github.com/elifoster/oocsv-rb

csv-reading dynamic ruby-gem

Last synced: 15 days ago
JSON representation

A very dynamic object-oriented approach to CSV reading and writing.

Awesome Lists containing this project

README

        

# oocsv
[![Gem Version](https://badge.fury.io/rb/oocsv.svg)](https://badge.fury.io/rb/oocsv)

A very dynamic object-oriented approach to CSV reading and writing.

## Installation
### RubyGems
```shell
$ gem install oocsv
```

### Bundler
Add this line to the application's Gemfile:

```ruby
gem('oocsv')
```

And then execute:

```shell
$ bundle
```

## Usage
```ruby
require 'oocsv'

str = < "Year,Make,Model,Length\n1997,Ford,E350,2.34\n2000,Mercury,Cougar,2.38\n"

ary = OOCSV.read(str)
# => [#, #]

print OOCSV.write(ary)
# Year,Make,Model,Length
# 1997,Ford,E350,2.34
# 2000,Mercury,Cougar,2.38

ary[0].to_s
# => "#"
```