summaryrefslogtreecommitdiffhomepage
path: root/lib/axlsx/util/validators.rb
diff options
context:
space:
mode:
authorRandy Morgan <[email protected]>2012-05-24 02:55:49 -0700
committerRandy Morgan <[email protected]>2012-05-24 02:55:49 -0700
commitaaac7558a4a5ca3b7a62d85202545662d17a296b (patch)
tree92f0f82ae90e63a1ff920e2912b813a8a2ad39c0 /lib/axlsx/util/validators.rb
parentb33dae1dab71485f8b292e9212dd4ab0c62b6812 (diff)
parent7ae571e152717841fdabe8eae7d1cba65ebfde4d (diff)
downloadcaxlsx-aaac7558a4a5ca3b7a62d85202545662d17a296b.tar.gz
caxlsx-aaac7558a4a5ca3b7a62d85202545662d17a296b.zip
Merge pull request #98 from janhuehne/data_validation
Data validation
Diffstat (limited to 'lib/axlsx/util/validators.rb')
-rw-r--r--lib/axlsx/util/validators.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/axlsx/util/validators.rb b/lib/axlsx/util/validators.rb
index 2f43a121..27d895e8 100644
--- a/lib/axlsx/util/validators.rb
+++ b/lib/axlsx/util/validators.rb
@@ -217,4 +217,25 @@ module Axlsx
RestrictionValidator.validate :table_element_type, [:wholeTable, :headerRow, :totalRow, :firstColumn, :lastColumn, :firstRowStripe, :secondRowStripe, :firstColumnStripe, :secondColumnStripe, :firstHeaderCell, :lastHeaderCell, :firstTotalCell, :lastTotalCell, :firstSubtotalColumn, :secondSubtotalColumn, :thirdSubtotalColumn, :firstSubtotalRow, :secondSubtotalRow, :thirdSubtotalRow, :blankRow, :firstColumnSubheading, :secondColumnSubheading, :thirdColumnSubheading, :firstRowSubheading, :secondRowSubheading, :thirdRowSubheading, :pageFieldLabels, :pageFieldValues], v
end
+ # Requires that the value is a valid data_validation_error_style
+ # :information, :stop, :warning
+ # @param [Any] v The value validated
+ def self.validate_data_validation_error_style(v)
+ RestrictionValidator.validate :validate_data_validation_error_style, [:information, :stop, :warning], v
+ end
+
+ # Requires that the value is valid data validation operator.
+ # valid operators must be one of lessThan, lessThanOrEqual, equal,
+ # notEqual, greaterThanOrEqual, greaterThan, between, notBetween
+ # @param [Any] v The value validated
+ def self.validate_data_validation_operator(v)
+ RestrictionValidator.validate :data_validation_operator, [:lessThan, :lessThanOrEqual, :equal, :notEqual, :greaterThanOrEqual, :greaterThan, :between, :notBetween], v
+ end
+
+ # Requires that the value is valid data validation type.
+ # valid types must be one of custom, data, decimal, list, none, textLength, time, whole
+ # @param [Any] v The value validated
+ def self.validate_data_validation_type(v)
+ RestrictionValidator.validate :data_validation_type, [:custom, :data, :decimal, :list, :none, :textLength, :time, :whole], v
+ end
end