flexy-odf-report 0.1 → 0.1.1
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.
- data/lib/odf-report/table.rb +7 -1
- data/odf-report.gemspec +1 -1
- metadata +1 -1
data/lib/odf-report/table.rb
CHANGED
@@ -26,10 +26,16 @@ class Table
|
|
26
26
|
#
|
27
27
|
# New version
|
28
28
|
#
|
29
|
+
# Adds column only if condition is not evaluated to false.
|
30
|
+
# If condition equals :no_render_nil and field is nil then
|
31
|
+
# nothing is done (no column is added).
|
32
|
+
#
|
29
33
|
def add_column_if(condition, name, field=nil, &block)
|
30
34
|
if condition
|
31
35
|
# Only render the column if condition holds true...
|
32
|
-
if field
|
36
|
+
if field.nil? && condition == :no_render_nil
|
37
|
+
# Nix
|
38
|
+
elsif field
|
33
39
|
@fields[name] = lambda { |item| item.send(field)}
|
34
40
|
elsif block_given?
|
35
41
|
@fields[name] = block
|
data/odf-report.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{flexy-odf-report}
|
5
|
-
s.version = "0.1"
|
5
|
+
s.version = "0.1.1"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Sandro Duarte", "Mark von Zeschau"]
|