class OoxmlParser::Protection

Class for parsing <protection> tag

Attributes

hidden[R]

@return [True, False] Specifies if formulas in cell are hidden

locked[R]

@return [True, False] Specifies if cell is locked

Public Class Methods

new(parent: nil) click to toggle source
Calls superclass method OoxmlParser::OOXMLDocumentObject::new
# 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

Public Instance Methods

parse(node) click to toggle source

Parse Protection data @param [Nokogiri::XML:Element] node with Protection data @return [Sheet] value of Protection

# 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