fasterer-csv 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. data/lib/fasterer_csv.rb +13 -7
  2. metadata +2 -2
data/lib/fasterer_csv.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # Say hi to Rex for me!
2
+
1
3
  require 'rubygems'
2
4
  require 'stringio'
3
5
 
@@ -57,13 +59,17 @@ module FastererCSV
57
59
  super(array)
58
60
  end
59
61
 
60
- def [](i)
61
- if i.class == Fixnum
62
- super
63
- else
64
- found = headers.index(Row::to_key(i))
65
- found ? super(found) : nil
62
+ def [](*is)
63
+ is.each do |i|
64
+ val = if i.class == Fixnum
65
+ super
66
+ else
67
+ found = headers.index(Row::to_key(i))
68
+ found ? super(found) : nil
69
+ end
70
+ return val unless val.nil?
66
71
  end
72
+ nil
67
73
  end
68
74
 
69
75
  def []=(key, val)
@@ -170,7 +176,7 @@ module FastererCSV
170
176
  end
171
177
  table << row
172
178
  elsif field
173
- row << (column.empty? ? nil : column.join)
179
+ row << (column.empty? ? nil : column.join)
174
180
  end
175
181
 
176
182
  table.each do |line|
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 1
9
- version: 0.0.1
8
+ - 2
9
+ version: 0.0.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Mason