Sha256: 7f0e58d3193055ce0e9e8e0d900b71175bbeb4951f12fd8962c3d0a66c321f50

Contents?: true

Size: 1.16 KB

Versions: 17

Compression:

Stored size: 1.16 KB

Contents

# encoding: UTF-8
module Axlsx
  # CellProtection stores information about locking or hiding cells in spreadsheet.
  # @note Using Styles#add_style is the recommended way to manage cell protection.
  # @see Styles#add_style
  class CellProtection

    include Axlsx::OptionsParser
    include Axlsx::SerializedAttributes

    serializable_attributes :hidden, :locked

    # specifies locking for cells that have the style containing this protection
    # @return [Boolean]
    attr_reader :hidden

    # specifies if the cells that have the style containing this protection
    # @return [Boolean]
    attr_reader :locked

    # Creates a new CellProtection
    # @option options [Boolean] hidden value for hidden protection
    # @option options [Boolean] locked value for locked protection
    def initialize(options={})
      parse_options options
    end

    # @see hidden
    def hidden=(v) Axlsx::validate_boolean v; @hidden = v end
    # @see locked
    def locked=(v) Axlsx::validate_boolean v; @locked = v end

    # Serializes the object
    # @param [String] str
    # @return [String]
    def to_xml_string(str = '')
      serialized_tag('protection', str)
    end

  end
end

Version data entries

17 entries across 17 versions & 6 rubygems

Version Path
caxlsx-3.3.0 lib/axlsx/stylesheet/cell_protection.rb
caxlsx-3.1.1 lib/axlsx/stylesheet/cell_protection.rb
caxlsx-3.1.0 lib/axlsx/stylesheet/cell_protection.rb
bonio-axlsx-2.2.3 lib/axlsx/stylesheet/cell_protection.rb
caxlsx-3.0.4 lib/axlsx/stylesheet/cell_protection.rb
caxlsx-3.0.3 lib/axlsx/stylesheet/cell_protection.rb
caxlsx-3.0.2 lib/axlsx/stylesheet/cell_protection.rb
caxlsx-3.0.1 lib/axlsx/stylesheet/cell_protection.rb
caxlsx-3.0.0 lib/axlsx/stylesheet/cell_protection.rb
axlsx-alt-3.0.1 lib/axlsx/stylesheet/cell_protection.rb
axlsx-alt-3.0.0 lib/axlsx/stylesheet/cell_protection.rb
axlsx-3.0.0.pre lib/axlsx/stylesheet/cell_protection.rb
bonio-axlsx-2.2.2 lib/axlsx/stylesheet/cell_protection.rb
bonio-axlsx-2.2.1 lib/axlsx/stylesheet/cell_protection.rb
dg-axlsx-2.1.0 lib/axlsx/stylesheet/cell_protection.rb
axlsx-2.1.0.pre lib/axlsx/stylesheet/cell_protection.rb
l_axlsx-2.0.1 lib/axlsx/stylesheet/cell_protection.rb