No commit activity in last 3 years
No release in over 3 years
module for setter and getter with coordinate like csv.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 1.9
~> 10.0
>= 0
 Project Readme

CSVCoordinateAccessor

CSVCoordinateAccessor is module for setter and getter with coordinate like csv.

Installation

Add this line to your application's Gemfile:

gem 'csv_coordinate_accessor'

And then execute:

$ bundle

Or install it yourself as:

$ gem install csv_coordinate_accessor

Usage

require 'csv_coordinate_accessor'
csv = CSV.read('./spec/fixtures/sample.csv')
=> [["id", "category", "name"], ["1", "fruit", "apple"], ["2", "furit", "orange"], ["3", "fruit", "banana"]]

## Extend module
csv = csv.extend CSVCoordinateAccessor

## get value with coordinate
csv.get('A2')
=> "1"
csv.get('B2')
=> "fruit"
csv.get('C2')
=> "apple"

## set value with coordinate
csv.set('C2', 'pineapple')

csv
=> [["id", "category", "name"], ["1", "fruit", "pineapple"], ["2", "furit", "orange"], ["3", "fruit", "banana"]]

Contributing

  1. Fork it ( https://github.com/[my-github-username]/csv_coordinate_accessor/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request