fasterer-csv 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/fasterer_csv.rb +13 -7
- 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 [](
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
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|
|