From 0a25dbeb32e20a3e8557e9dc32ea380cc543ae2a Mon Sep 17 00:00:00 2001 From: Randy Morgan Date: Sun, 25 Nov 2012 14:49:36 +0900 Subject: Updated readme and docs for pre 1.3.4 release --- lib/axlsx/util/serialized_attributes.rb | 2 ++ lib/axlsx/util/validators.rb | 1 + lib/axlsx/workbook/worksheet/color_scale.rb | 13 +++++++++++++ 3 files changed, 16 insertions(+) (limited to 'lib') 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'}, -- cgit v1.2.3