Class: OoxmlParser::DefinedName
- Inherits:
-
OOXMLDocumentObject
- Object
- OOXMLDocumentObject
- OoxmlParser::DefinedName
- Defined in:
- lib/ooxml_parser/xlsx_parser/workbook/defined_name.rb
Overview
Class for parsing <definedName> tag
Instance Attribute Summary collapse
-
#hidden ⇒ Symbol
readonly
Specifies whether defined name is hidden.
-
#local_sheet_id ⇒ String
readonly
Id of sheet.
-
#name ⇒ String
readonly
Name.
-
#range ⇒ String
readonly
Ranges to which defined name refers.
Attributes inherited from OOXMLDocumentObject
Instance Method Summary collapse
-
#parse(node) ⇒ DefinedName
Parse Defined Name data.
Methods inherited from OOXMLDocumentObject
#==, #boolean_attribute_value, #initialize, #parse_xml, #with_data?
Methods included from OoxmlObjectAttributeHelper
#attribute_enabled?, #option_enabled?
Methods included from OoxmlDocumentObjectHelper
Constructor Details
This class inherits a constructor from OoxmlParser::OOXMLDocumentObject
Instance Attribute Details
#hidden ⇒ Symbol (readonly)
Returns Specifies whether defined name is hidden.
13 14 15 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/defined_name.rb', line 13 def hidden @hidden end |
#local_sheet_id ⇒ String (readonly)
Returns Id of sheet.
11 12 13 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/defined_name.rb', line 11 def local_sheet_id @local_sheet_id end |
#name ⇒ String (readonly)
Returns Name.
9 10 11 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/defined_name.rb', line 9 def name @name end |
#range ⇒ String (readonly)
Returns Ranges to which defined name refers.
7 8 9 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/defined_name.rb', line 7 def range @range end |
Instance Method Details
#parse(node) ⇒ DefinedName
Parse Defined Name data
18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/defined_name.rb', line 18 def parse(node) @range = node.text node.attributes.each do |key, value| case key when 'name' @name = value.value.to_s when 'localSheetId' @local_sheet_id = value.value.to_i when 'hidden' @hidden = attribute_enabled?(value) end end self end |