class OoxmlParser::DataValidation
Class for ‘dataValidation` data
Attributes
@return [Boolean] should blank entries be valid
@return [String] Specifies the message text of the error alert
@return [Symbol] Type of error
@return [String] The text of the title bar of the error alert
@return [DataValidationFormula] first formula of data validation
@return [DataValidationFormula] second formula of data validation
@return [Symbol] Input Method Editor (IME) mode
@return [Symbol] Relational operator used with this data validation
@return [String] Message text of the input prompt
@return [String] Text
of the title bar of the input prompt
@return [String] Ranges to which data validation is applied
@return [Symbol] Specifies whether to display the drop-down combo box
@return [Symbol] Specifies whether to display error alert message
@return [Symbol] Specifies whether to display the input prompt
@return [Symbol] Type of validation
@return [String] UID of validation
Public Instance Methods
Parse DataValidation
data @param [Nokogiri::XML:Element] node with DataValidation
data @return [DataValidation] value of DataValidation
data
# File lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/data_validations/data_validation.rb, line 43 def parse(node) node.attributes.each do |key, value| case key when 'allowBlank' @allow_blank = attribute_enabled?(value) when 'error' @error = value.value.to_s when 'errorStyle' @error_style = value.value.to_sym when 'errorTitle' @error_title = value.value.to_s when 'imeMode' @ime_mode = value.value.to_sym when 'operator' @operator = value.value.to_sym when 'type' @type = value.value.to_sym when 'prompt' @prompt = value.value.to_s when 'promptTitle' @prompt_title = value.value.to_s when 'showDropDown' @show_dropdown = attribute_enabled?(value) when 'showInputMessage' @show_input_message = attribute_enabled?(value) when 'showErrorMessage' @show_error_message = attribute_enabled?(value) when 'uid' @uid = value.value.to_s end end node.xpath('*').each do |node_child| case node_child.name when 'formula1' @formula1 = DataValidationFormula.new(parent: self).parse(node_child) when 'formula2' @formula2 = DataValidationFormula.new(parent: self).parse(node_child) when 'sqref' @reference_sequence = node_child.text end end self end