Class: OoxmlParser::Fills
- Inherits:
-
OOXMLDocumentObject
- Object
- OOXMLDocumentObject
- OoxmlParser::Fills
- Defined in:
- lib/ooxml_parser/xlsx_parser/workbook/style_sheet/fills.rb
Overview
Parsing ‘fonts` tag
Instance Attribute Summary collapse
-
#fills_array ⇒ Array, Fill
Array of fills.
Attributes inherited from OOXMLDocumentObject
Instance Method Summary collapse
-
#[](key) ⇒ Array, Fill
Accessor.
-
#initialize(parent: nil) ⇒ Fills
constructor
A new instance of Fills.
-
#parse(node) ⇒ Fills
Parse Fills 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) ⇒ Fills
Returns a new instance of Fills.
10 11 12 13 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/style_sheet/fills.rb', line 10 def initialize(parent: nil) @fills_array = [] super end |
Instance Attribute Details
#fills_array ⇒ Array, Fill
Returns array of fills.
8 9 10 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/style_sheet/fills.rb', line 8 def fills_array @fills_array end |
Instance Method Details
#[](key) ⇒ Array, Fill
Returns accessor.
16 17 18 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/style_sheet/fills.rb', line 16 def [](key) @fills_array[key] end |
#parse(node) ⇒ Fills
Parse Fills data
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/style_sheet/fills.rb', line 23 def parse(node) node.attributes.each do |key, value| case key when 'count' @count = value.value.to_i end end node.xpath('*').each do |node_child| case node_child.name when 'fill' @fills_array << Fill.new(parent: self).parse(node_child) end end self end |