Sha256: dbadece83284bf16a0819191c803d7dcfa5d043ba6a824785372847147efc98f

Contents?: true

Size: 1.36 KB

Versions: 17

Compression:

Stored size: 1.36 KB

Contents

module Axlsx
  # The Protected Range class represents a set of cells in the worksheet
  # @note the recommended way to manage protected ranges with via Worksheet#protect_range
  # @see Worksheet#protect_range
  class ProtectedRange

    include Axlsx::OptionsParser
    include Axlsx::SerializedAttributes

   # Initializes a new protected range object
    # @option [String] sqref The cell range reference to protect. This can be an absolute or a relateve range however, it only applies to the current sheet.
    # @option [String] name An optional name for the protected name.
    def initialize(options={})
      parse_options options
      yield self if block_given?
    end

    serializable_attributes :sqref, :name
    # The reference for the protected range
    # @return [String]
    attr_reader :sqref

    # The name of the protected range
    # @return [String]
    attr_reader :name

    # @see sqref
    def sqref=(v)
      Axlsx.validate_string(v)
      @sqref = v
    end

    # @see name
    def name=(v)
      Axlsx.validate_string(v)
      @name = v
    end

    # serializes the proteted range
    # @param [String] str if this string object is provided we append
    # our output to that object. Use this - it helps limit the number of
    # objects created during serialization
    def to_xml_string(str="")
      serialized_tag 'protectedRange', str
    end 
  end
end

Version data entries

17 entries across 17 versions & 6 rubygems

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