Sha256: eb7599114ee4e8a07b1cdd0f741ebe7e30381f2977f5c12a4ff3457f843978b6

Contents?: true

Size: 915 Bytes

Versions: 32

Compression:

Stored size: 915 Bytes

Contents

# frozen_string_literal: true

module OoxmlParser
  # Class for parsing <definedName> tag
  class DefinedName < OOXMLDocumentObject
    # @return [String] Ranges to which defined name refers
    attr_reader :range
    # @return [String] Name
    attr_reader :name
    # @return [String] Id of sheet
    attr_reader :local_sheet_id
    # @return [Symbol] Specifies whether defined name is hidden
    attr_reader :hidden

    # Parse Defined Name data
    # @param [Nokogiri::XML:Element] node with DefinedName data
    # @return [DefinedName] value of DefinedName
    def parse(node)
      @range = node.text
      node.attributes.each do |key, value|
        case key
        when 'name'
          @name = value.value.to_s
        when 'localSheetId'
          @local_sheet_id = value.value.to_i
        when 'hidden'
          @hidden = attribute_enabled?(value)
        end
      end
      self
    end
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
ooxml_parser-0.21.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/defined_name.rb
ooxml_parser-0.20.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/defined_name.rb
ooxml_parser-0.19.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/defined_name.rb
ooxml_parser-0.18.1 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/defined_name.rb
ooxml_parser-0.18.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/defined_name.rb
ooxml_parser-0.17.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/defined_name.rb
ooxml_parser-0.16.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/defined_name.rb
ooxml_parser-0.15.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/defined_name.rb
ooxml_parser-0.14.2 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/defined_name.rb
ooxml_parser-0.14.1-mingw32 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/defined_name.rb
ooxml_parser-0.14.1 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/defined_name.rb
ooxml_parser-0.14.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/defined_name.rb