lib/rubyXL/objects/data_validation.rb in rubyXL-2.1.1 vs lib/rubyXL/objects/data_validation.rb in rubyXL-2.2.0
- old
+ new
@@ -1,21 +1,16 @@
require 'rubyXL/objects/ooxml_object'
+require 'rubyXL/objects/simple_types'
require 'rubyXL/objects/formula'
module RubyXL
# http://www.schemacentral.com/sc/ooxml/e-ssml_dataValidation-1.html
class DataValidation < OOXMLObject
- define_attribute(:type, :string, :default => 'none',
- :values => %w{ none whole decimal list date time textLength custom })
- define_attribute(:errorStyle, :string, :default => 'stop',
- :values => %w{ stop warning information })
- define_attribute(:imeMode, :string, :default => 'noControl',
- :values => %w{ noControl off on disabled hiragana fullKatakana halfKatakana
- fullAlpha halfAlpha fullHangul halfHangul })
- define_attribute(:operator, :string, :default => 'between',
- :values => %w{ between notBetween equal notEqual lessThan lessThanOrEqual
- greaterThan greaterThanOrEqual })
+ define_attribute(:type, RubyXL::ST_DataValidationType, :default => 'none')
+ define_attribute(:errorStyle, RubyXL::ST_DataValidationErrorStyle, :default => 'stop')
+ define_attribute(:imeMode, RubyXL::ST_DataValidationImeMode, :default => 'noControl')
+ define_attribute(:operator, RubyXL::ST_DataValidationOperator, :default => 'between')
define_attribute(:allowBlank, :bool, :default => false)
define_attribute(:showDropDown, :bool, :default => false)
define_attribute(:showInputMessage, :bool, :default => false)
define_attribute(:showErrorMessage, :bool, :default => false)
define_attribute(:errorTitle, :string)