summaryrefslogtreecommitdiffhomepage
path: root/lib/axlsx/util/validators.rb
diff options
context:
space:
mode:
authorRandy Morgan <[email protected]>2012-04-21 11:28:07 +0900
committerRandy Morgan <[email protected]>2012-04-21 11:28:07 +0900
commita7072a25772a7613620ee60cb607e62ad2db743e (patch)
treee11f90ac9b6bb96fa22a1f5fa76261594135a935 /lib/axlsx/util/validators.rb
parentab3364b7a88f4054a3b4b8f55263688b7e2bc9d7 (diff)
downloadcaxlsx-a7072a25772a7613620ee60cb607e62ad2db743e.tar.gz
caxlsx-a7072a25772a7613620ee60cb607e62ad2db743e.zip
adding in color scale for conditional formatting
Diffstat (limited to 'lib/axlsx/util/validators.rb')
-rw-r--r--lib/axlsx/util/validators.rb16
1 files changed, 11 insertions, 5 deletions
diff --git a/lib/axlsx/util/validators.rb b/lib/axlsx/util/validators.rb
index 14d34d36..555bc038 100644
--- a/lib/axlsx/util/validators.rb
+++ b/lib/axlsx/util/validators.rb
@@ -101,21 +101,27 @@ module Axlsx
# thisMonth, lastMonth, nextMonth, thisWeek, lastWeek, nextWeek
def self.validate_time_period_type(v)
RestrictionValidator.validate :time_period_type, [:today, :yesterday, :tomorrow, :last7Days, :thisMonth, :lastMonth, :nextMonth, :thisWeek, :lastWeek, :nextWeek], v
-
-
+
+
end
-
+
# Requires that the value is valid conditional formatting type.
# valid types must be one of expression, cellIs, colorScale,
# dataBar, iconSet, top10, uniqueValues, duplicateValues,
# containsText, notContainsText, beginsWith, endsWith,
# containsBlanks, notContainsBlanks, containsErrors,
- # notContainsErrors, timePeriod, aboveAverage
+ # notContainsErrors, timePeriod, aboveAverage
# @param [Any] v The value validated
def self.validate_conditional_formatting_type(v)
RestrictionValidator.validate :conditional_formatting_type, [:expression, :cellIs, :colorScale, :dataBar, :iconSet, :top10, :uniqueValues, :duplicateValues, :containsText, :notContainsText, :beginsWith, :endsWith, :containsBlanks, :notContainsBlanks, :containsErrors, :notContainsErrors, :timePeriod, :aboveAverage], v
end
+ # Requires thatt he value is a valid conditional formatting value object type.
+ # valid types must be one of num, percent, max, min, formula and percentile
+ def self.validate_conditional_formatting_value_object_type(v)
+ RestrictionValidator.validate :conditional_formatting_value_object_type, [:num, :percent, :max, :min, :formula, :percentile], v
+ end
+
# Requires that the value is valid conditional formatting operator.
# valid operators must be one of lessThan, lessThanOrEqual, equal,
# notEqual, greaterThanOrEqual, greaterThan, between, notBetween,
@@ -124,7 +130,7 @@ module Axlsx
def self.validate_conditional_formatting_operator(v)
RestrictionValidator.validate :conditional_formatting_type, [:lessThan, :lessThanOrEqual, :equal, :notEqual, :greaterThanOrEqual, :greaterThan, :between, :notBetween, :containsText, :notContains, :beginsWith, :endsWith], v
end
-
+
# Requires that the value is a gradient_type.
# valid types are :linear and :path
# @param [Any] v The value validated