Class: OoxmlParser::DataValidations
- Inherits:
-
OOXMLDocumentObject
- Object
- OOXMLDocumentObject
- OoxmlParser::DataValidations
- Defined in:
- lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/data_validations.rb
Overview
Class for ‘dataValidations` data
Instance Attribute Summary collapse
-
#count ⇒ Integer
readonly
Count of validations.
-
#data_validations ⇒ Array<DataValidation>
readonly
List of data validations.
-
#disable_prompts ⇒ Boolean
readonly
Is prompts disabled.
Attributes inherited from OOXMLDocumentObject
Instance Method Summary collapse
-
#[](key) ⇒ SparklineGroup
Accessor.
-
#initialize(parent: nil) ⇒ DataValidations
constructor
A new instance of DataValidations.
-
#parse(node) ⇒ DataValidations
Parse DataValidations data.
Methods inherited from OOXMLDocumentObject
#==, #boolean_attribute_value, #parse_xml, #with_data?
Methods included from OoxmlObjectAttributeHelper
#attribute_enabled?, #option_enabled?
Methods included from OoxmlDocumentObjectHelper
Constructor Details
#initialize(parent: nil) ⇒ DataValidations
Returns a new instance of DataValidations.
15 16 17 18 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/data_validations.rb', line 15 def initialize(parent: nil) @data_validations = [] super end |
Instance Attribute Details
#count ⇒ Integer (readonly)
Returns count of validations.
9 10 11 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/data_validations.rb', line 9 def count @count end |
#data_validations ⇒ Array<DataValidation> (readonly)
Returns list of data validations.
11 12 13 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/data_validations.rb', line 11 def data_validations @data_validations end |
#disable_prompts ⇒ Boolean (readonly)
Returns is prompts disabled.
13 14 15 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/data_validations.rb', line 13 def disable_prompts @disable_prompts end |
Instance Method Details
#[](key) ⇒ SparklineGroup
Returns accessor.
21 22 23 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/data_validations.rb', line 21 def [](key) data_validations[key] end |
#parse(node) ⇒ DataValidations
Parse DataValidations data
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/data_validations.rb', line 28 def parse(node) node.attributes.each do |key, value| case key when 'count' @count = value.value.to_i when 'disablePrompts' @disable_prompts = attribute_enabled?(value) end end node.xpath('*').each do |node_child| case node_child.name when 'dataValidation' @data_validations << DataValidation.new(parent: self).parse(node_child) end end self end |