rubyexcel 0.2.1 → 0.2.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.
- checksums.yaml +4 -4
- data/lib/rubyexcel/section.rb +32 -12
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 51f075424b62a47b35195d5866af543f3acbe170
|
4
|
+
data.tar.gz: f313aa0ff0ad8eb6e29e39db4edf1c633d583c5b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fe22727fb20c44580b7e9c2089c52c636d6a6141e9bca679d0b135b23547e5bf30111982f5774c7a25be425260c065c4480809d16d689b25a3e74d20f94d28ec
|
7
|
+
data.tar.gz: f78b59c475d59a76be6c7e8a866b0f5134d8726677c985c6fda30c4203bf3e55f6ce9ebaf174100897c41b77a277719d002681870dd315487d1d2553f7c18807
|
data/lib/rubyexcel/section.rb
CHANGED
@@ -26,18 +26,6 @@ module RubyExcel
|
|
26
26
|
@data = sheet.data
|
27
27
|
end
|
28
28
|
|
29
|
-
#
|
30
|
-
# Append a value to the Section.
|
31
|
-
#
|
32
|
-
# @param [Object] value the object to append
|
33
|
-
# @note This only adds an extra cell if it is the first Row / Column.
|
34
|
-
# This prevents a loop through Rows or Columns from extending diagonally away from the main data.
|
35
|
-
#
|
36
|
-
|
37
|
-
def <<( value )
|
38
|
-
data[ translate_address( ( col_index( idx ) == 1 ? data.cols + 1 : data.cols ) ) ] = value
|
39
|
-
end
|
40
|
-
|
41
29
|
#
|
42
30
|
# Access a cell by its index within the Section
|
43
31
|
#
|
@@ -120,6 +108,14 @@ module RubyExcel
|
|
120
108
|
"#{ self.class }:0x#{ '%x' % (object_id << 1) }: #{ idx }"
|
121
109
|
end
|
122
110
|
|
111
|
+
#
|
112
|
+
# Return the value of the last cell
|
113
|
+
#
|
114
|
+
|
115
|
+
def last
|
116
|
+
last_cell.value
|
117
|
+
end
|
118
|
+
|
123
119
|
#
|
124
120
|
# Return the last cell
|
125
121
|
#
|
@@ -218,6 +214,18 @@ module RubyExcel
|
|
218
214
|
super( sheet )
|
219
215
|
end
|
220
216
|
|
217
|
+
#
|
218
|
+
# Append a value to the Row.
|
219
|
+
#
|
220
|
+
# @param [Object] value the object to append
|
221
|
+
# @note This only adds an extra cell if it is the first Row
|
222
|
+
# This prevents a loop through Rows from extending diagonally away from the main data.
|
223
|
+
#
|
224
|
+
|
225
|
+
def <<( value )
|
226
|
+
data[ translate_address( idx == 1 ? data.cols + 1 : data.cols ) ] = value
|
227
|
+
end
|
228
|
+
|
221
229
|
#
|
222
230
|
# Access a Cell by its header
|
223
231
|
#
|
@@ -315,6 +323,18 @@ module RubyExcel
|
|
315
323
|
super( sheet )
|
316
324
|
end
|
317
325
|
|
326
|
+
#
|
327
|
+
# Append a value to the Column.
|
328
|
+
#
|
329
|
+
# @param [Object] value the object to append
|
330
|
+
# @note This only adds an extra cell if it is the first Column.
|
331
|
+
# This prevents a loop through Columns from extending diagonally away from the main data.
|
332
|
+
#
|
333
|
+
|
334
|
+
def <<( value )
|
335
|
+
data[ translate_address( idx == 'A' ? data.rows + 1 : data.rows ) ] = value
|
336
|
+
end
|
337
|
+
|
318
338
|
#
|
319
339
|
# The number of Rows in the Column
|
320
340
|
#
|