to_xls 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/to_xls.rb +6 -2
- data/to_xls.gemspec +1 -1
- metadata +3 -3
data/lib/to_xls.rb
CHANGED
@@ -45,7 +45,9 @@ class Array
|
|
45
45
|
|
46
46
|
private
|
47
47
|
def aux_to_xls(item, column, row)
|
48
|
-
if
|
48
|
+
if item.nil?
|
49
|
+
row.push(nil)
|
50
|
+
elsif column.is_a?(String) or column.is_a?(Symbol)
|
49
51
|
row.push(item.send(column))
|
50
52
|
elsif column.is_a?(Hash)
|
51
53
|
column.each{|key, values| aux_to_xls(item.send(key), values, row)}
|
@@ -55,7 +57,9 @@ class Array
|
|
55
57
|
end
|
56
58
|
|
57
59
|
def aux_headers_to_xls(item, column, row)
|
58
|
-
if
|
60
|
+
if item.nil?
|
61
|
+
row.push(nil)
|
62
|
+
elsif column.is_a?(String) or column.is_a?(Symbol)
|
59
63
|
row.push("#{item.class.name.underscore}_#{column}")
|
60
64
|
elsif column.is_a?(Hash)
|
61
65
|
column.each{|key, values| aux_headers_to_xls(item.send(key), values, row)}
|
data/to_xls.gemspec
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: to_xls
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 25
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 1
|
10
|
+
version: 0.1.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Enrique Garcia Cota
|