Class: Axlsx::CellProtection
- Inherits:
-
Object
- Object
- Axlsx::CellProtection
- Defined in:
- lib/axlsx/stylesheet/cell_protection.rb
Overview
Note:
Using Styles#add_style is the recommended way to manage cell protection.
CellProtection stores information about locking or hiding cells in spreadsheet.
Instance Attribute Summary (collapse)
-
- (Boolean) hidden
specifies locking for cells that have the style containing this protection.
-
- (Boolean) locked
specifies if the cells that have the style containing this protection.
Instance Method Summary (collapse)
-
- (CellProtection) initialize(options = {})
constructor
Creates a new CellProtection.
-
- (String) to_xml(xml)
Serializes the cell protection.
Constructor Details
- (CellProtection) initialize(options = {})
Creates a new CellProtection
18 19 20 21 22 |
# File 'lib/axlsx/stylesheet/cell_protection.rb', line 18 def initialize(={}) .each do |o| self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}=" end end |
Instance Attribute Details
specifies locking for cells that have the style containing this protection
9 10 11 |
# File 'lib/axlsx/stylesheet/cell_protection.rb', line 9 def hidden @hidden end |
- (Boolean) locked
specifies if the cells that have the style containing this protection
13 14 15 |
# File 'lib/axlsx/stylesheet/cell_protection.rb', line 13 def locked @locked end |
Instance Method Details
- (String) to_xml(xml)
Serializes the cell protection
29 30 31 |
# File 'lib/axlsx/stylesheet/cell_protection.rb', line 29 def to_xml(xml) xml.protection(self.instance_values) end |