Class: OoxmlParser::ColorScale
- Inherits:
-
OOXMLDocumentObject
- Object
- OOXMLDocumentObject
- OoxmlParser::ColorScale
- Defined in:
- lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/conditional_formattings/conditional_formatting/conditional_formatting_rule/color_scale.rb
Overview
Class for ‘colorScale` data
Instance Attribute Summary collapse
-
#colors ⇒ Array<OoxmlColor>
readonly
List of colors.
-
#values ⇒ Array<ConditionalFormatValueObject>
readonly
List of values.
Attributes inherited from OOXMLDocumentObject
Instance Method Summary collapse
-
#initialize(parent: nil) ⇒ ColorScale
constructor
A new instance of ColorScale.
-
#parse(node) ⇒ ColorScale
Parse ColorScale 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) ⇒ ColorScale
Returns a new instance of ColorScale.
11 12 13 14 15 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/conditional_formattings/conditional_formatting/conditional_formatting_rule/color_scale.rb', line 11 def initialize(parent: nil) @values = [] @colors = [] super end |
Instance Attribute Details
#colors ⇒ Array<OoxmlColor> (readonly)
Returns list of colors.
9 10 11 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/conditional_formattings/conditional_formatting/conditional_formatting_rule/color_scale.rb', line 9 def colors @colors end |
#values ⇒ Array<ConditionalFormatValueObject> (readonly)
Returns list of values.
7 8 9 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/conditional_formattings/conditional_formatting/conditional_formatting_rule/color_scale.rb', line 7 def values @values end |
Instance Method Details
#parse(node) ⇒ ColorScale
Parse ColorScale 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/conditional_formatting_rule/color_scale.rb', line 20 def parse(node) node.xpath('*').each do |node_child| case node_child.name when 'cfvo' @values << ConditionalFormatValueObject.new(parent: self).parse(node_child) when 'color' @colors << OoxmlColor.new(parent: self).parse(node_child) end end self end |