Class: OoxmlParser::Protection
- Inherits:
-
OOXMLDocumentObject
- Object
- OOXMLDocumentObject
- OoxmlParser::Protection
- Defined in:
- lib/ooxml_parser/xlsx_parser/workbook/style_sheet/cell_xfs/cell_style/protection.rb
Overview
Class for parsing <protection> tag
Instance Attribute Summary collapse
-
#hidden ⇒ True, False
readonly
Specifies if formulas in cell are hidden.
-
#locked ⇒ True, False
readonly
Specifies if cell is locked.
Attributes inherited from OOXMLDocumentObject
Instance Method Summary collapse
-
#initialize(parent: nil) ⇒ Protection
constructor
A new instance of Protection.
-
#parse(node) ⇒ Sheet
Parse Protection 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) ⇒ Protection
Returns a new instance of Protection.
11 12 13 14 15 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/style_sheet/cell_xfs/cell_style/protection.rb', line 11 def initialize(parent: nil) @locked = true @hidden = false super end |
Instance Attribute Details
#hidden ⇒ True, False (readonly)
Returns Specifies if formulas in cell are hidden.
9 10 11 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/style_sheet/cell_xfs/cell_style/protection.rb', line 9 def hidden @hidden end |
#locked ⇒ True, False (readonly)
Returns Specifies if cell is locked.
7 8 9 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/style_sheet/cell_xfs/cell_style/protection.rb', line 7 def locked @locked end |
Instance Method Details
#parse(node) ⇒ Sheet
Parse Protection data
20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/style_sheet/cell_xfs/cell_style/protection.rb', line 20 def parse(node) node.attributes.each do |key, value| case key when 'locked' @locked = boolean_attribute_value(value) when 'hidden' @hidden = boolean_attribute_value(value) end end self end |