Class: OoxmlParser::ConditionalFormatting
- Inherits:
-
OOXMLDocumentObject
- Object
- OOXMLDocumentObject
- OoxmlParser::ConditionalFormatting
- Defined in:
- lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/conditional_formattings/conditional_formatting.rb
Overview
Class for ‘conditionalFormatting` data
Instance Attribute Summary collapse
-
#reference_sequence ⇒ String
readonly
Ranges to which conditional formatting is applied.
-
#rules ⇒ Array, ConditionalFormattingRule
readonly
List of conditional formatting rules.
Attributes inherited from OOXMLDocumentObject
Instance Method Summary collapse
-
#initialize(parent: nil) ⇒ ConditionalFormatting
constructor
A new instance of ConditionalFormatting.
-
#parse(node) ⇒ ConditionalFormatting
Parse ConditionalFormatting 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) ⇒ ConditionalFormatting
Returns a new instance of ConditionalFormatting.
12 13 14 15 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/conditional_formattings/conditional_formatting.rb', line 12 def initialize(parent: nil) @rules = [] super end |
Instance Attribute Details
#reference_sequence ⇒ String (readonly)
Returns Ranges to which conditional formatting is applied.
10 11 12 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/conditional_formattings/conditional_formatting.rb', line 10 def reference_sequence @reference_sequence end |
#rules ⇒ Array, ConditionalFormattingRule (readonly)
Returns list of conditional formatting rules.
8 9 10 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/conditional_formattings/conditional_formatting.rb', line 8 def rules @rules end |
Instance Method Details
#parse(node) ⇒ ConditionalFormatting
Parse ConditionalFormatting data
20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/conditional_formattings/conditional_formatting.rb', line 20 def parse(node) node.xpath('*').each do |node_child| case node_child.name when 'cfRule' @rules << ConditionalFormattingRule.new(parent: self).parse(node_child) when 'sqref' @reference_sequence = node_child.text end end self end |