Class: OoxmlParser::IconSet
- Inherits:
-
OOXMLDocumentObject
- Object
- OOXMLDocumentObject
- OoxmlParser::IconSet
- Defined in:
- lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/conditional_formattings/conditional_formatting/conditional_formatting_rule/icon_set.rb
Overview
Class for ‘iconSet` data
Instance Attribute Summary collapse
-
#custom ⇒ Symbol
readonly
Specifies whether icon set is custom.
-
#icons ⇒ Array<ConditionalFormattingIcon>
readonly
List of icons for custom sets.
-
#reverse ⇒ Symbol
readonly
Specifies whether icons are shown in reverse order.
-
#set ⇒ String
readonly
Name of icon set.
-
#show_value ⇒ Symbol
readonly
Specifies whether value is shown in a cell.
-
#values ⇒ Array<ConditionalFormatValueObject>
readonly
List of values.
Attributes inherited from OOXMLDocumentObject
Instance Method Summary collapse
-
#initialize(parent: nil) ⇒ IconSet
constructor
A new instance of IconSet.
-
#parse(node) ⇒ IconSet
Parse IconSet 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) ⇒ IconSet
Returns a new instance of IconSet.
20 21 22 23 24 25 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/conditional_formattings/conditional_formatting/conditional_formatting_rule/icon_set.rb', line 20 def initialize(parent: nil) @values = [] @icons = [] @show_value = true super end |
Instance Attribute Details
#custom ⇒ Symbol (readonly)
Returns Specifies whether icon set is custom.
14 15 16 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/conditional_formattings/conditional_formatting/conditional_formatting_rule/icon_set.rb', line 14 def custom @custom end |
#icons ⇒ Array<ConditionalFormattingIcon> (readonly)
Returns list of icons for custom sets.
18 19 20 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/conditional_formattings/conditional_formatting/conditional_formatting_rule/icon_set.rb', line 18 def icons @icons end |
#reverse ⇒ Symbol (readonly)
Returns Specifies whether icons are shown in reverse order.
10 11 12 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/conditional_formattings/conditional_formatting/conditional_formatting_rule/icon_set.rb', line 10 def reverse @reverse end |
#set ⇒ String (readonly)
Returns Name of icon set.
8 9 10 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/conditional_formattings/conditional_formatting/conditional_formatting_rule/icon_set.rb', line 8 def set @set end |
#show_value ⇒ Symbol (readonly)
Returns Specifies whether value is shown in a cell.
12 13 14 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/conditional_formattings/conditional_formatting/conditional_formatting_rule/icon_set.rb', line 12 def show_value @show_value end |
#values ⇒ Array<ConditionalFormatValueObject> (readonly)
Returns list of values.
16 17 18 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/conditional_formattings/conditional_formatting/conditional_formatting_rule/icon_set.rb', line 16 def values @values end |
Instance Method Details
#parse(node) ⇒ IconSet
Parse IconSet data
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/conditional_formattings/conditional_formatting/conditional_formatting_rule/icon_set.rb', line 30 def parse(node) node.attributes.each do |key, value| case key when 'iconSet' @set = value.value.to_s when 'reverse' @reverse = attribute_enabled?(value) when 'showValue' @show_value = attribute_enabled?(value) when 'custom' @custom = attribute_enabled?(value) end end node.xpath('*').each do |node_child| case node_child.name when 'cfvo' @values << ConditionalFormatValueObject.new(parent: self).parse(node_child) when 'cfIcon' @icons << ConditionalFormattingIcon.new(parent: self).parse(node_child) end end self end |