summaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorRandy Morgan <[email protected]>2012-11-25 14:49:36 +0900
committerRandy Morgan <[email protected]>2012-11-25 14:49:36 +0900
commit0a25dbeb32e20a3e8557e9dc32ea380cc543ae2a (patch)
tree801c1f8e3ed59613357a32a805d22920758913ca /lib
parent727f2ca539ca0dadb72e0982256284736cc44076 (diff)
downloadcaxlsx-0a25dbeb32e20a3e8557e9dc32ea380cc543ae2a.tar.gz
caxlsx-0a25dbeb32e20a3e8557e9dc32ea380cc543ae2a.zip
Updated readme and docs for pre 1.3.4 release
Diffstat (limited to 'lib')
-rw-r--r--lib/axlsx/util/serialized_attributes.rb2
-rw-r--r--lib/axlsx/util/validators.rb1
-rw-r--r--lib/axlsx/workbook/worksheet/color_scale.rb13
3 files changed, 16 insertions, 0 deletions
diff --git a/lib/axlsx/util/serialized_attributes.rb b/lib/axlsx/util/serialized_attributes.rb
index 30fcfaaa..5519f843 100644
--- a/lib/axlsx/util/serialized_attributes.rb
+++ b/lib/axlsx/util/serialized_attributes.rb
@@ -22,10 +22,12 @@ module Axlsx
@xml_attributes
end
+ # This helper registers the attributes that will be formatted as elements.
def serializable_element_attributes(*symbols)
@xml_element_attributes = symbols
end
+ # attr reader for element attributes
def xml_element_attributes
@xml_element_attributes
end
diff --git a/lib/axlsx/util/validators.rb b/lib/axlsx/util/validators.rb
index 55a49e72..cc8f0a92 100644
--- a/lib/axlsx/util/validators.rb
+++ b/lib/axlsx/util/validators.rb
@@ -145,6 +145,7 @@ module Axlsx
RestrictionValidator.validate "cell run style u", [:none, :single, :double, :singleAccounting, :doubleAccounting], v
end
+ # validates cell style family which must be between 1 and 5
def self.validate_family(v)
RestrictionValidator.validate "cell run style family", 1..5, v
end
diff --git a/lib/axlsx/workbook/worksheet/color_scale.rb b/lib/axlsx/workbook/worksheet/color_scale.rb
index 2b2c9d41..287e6869 100644
--- a/lib/axlsx/workbook/worksheet/color_scale.rb
+++ b/lib/axlsx/workbook/worksheet/color_scale.rb
@@ -8,15 +8,28 @@ module Axlsx
class ColorScale
class << self
+
+ # These are the default conditional formatting value objects
+ # that define a two tone color gradient.
def default_cfvos
[{:type => :min, :val => 0, :color => 'FFFF7128'},
{:type => :max, :val => 0, :color => 'FFFFEF9C'}]
end
+ # A builder for two tone color gradient
+ # @example
+ # # this creates a two tone color scale
+ # color_scale = Axlsx::ColorScale.two_tone
+ # @see examples/example.rb conditional formatting examples.
def two_tone
self.new
end
+ # A builder for three tone color gradient
+ # @example
+ # #this creates a three tone color scale
+ # color_scale = Axlsx::ColorScale.three_tone
+ # @see examples/example.rb conditional formatting examples.
def three_tone
self.new({:type => :min, :val => 0, :color => 'FFF8696B'},
{:type => :percent, :val => '50', :color => 'FFFFEB84'},