class Axlsx::ProtectedRange

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

Attributes

name[R]

The name of the protected range @return [String]

sqref[R]

The reference for the protected range @return [String]

Public Class Methods

new(options={}) { |self| ... } click to toggle source

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.

# File lib/axlsx/workbook/worksheet/protected_range.rb, line 13
def initialize(options={})
  parse_options options
  yield self if block_given?
end

Public Instance Methods

name=(v) click to toggle source

@see name

# File lib/axlsx/workbook/worksheet/protected_range.rb, line 34
def name=(v)
  Axlsx.validate_string(v)
  @name = v
end
sqref=(v) click to toggle source

@see sqref

# File lib/axlsx/workbook/worksheet/protected_range.rb, line 28
def sqref=(v)
  Axlsx.validate_string(v)
  @sqref = v
end
to_xml_string(str="") click to toggle source

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

# File lib/axlsx/workbook/worksheet/protected_range.rb, line 43
def to_xml_string(str="")
  str << '<protectedRange '
  serialized_attributes str
  str << '/>'
end