Class: OoxmlParser::SharedItems

Inherits:
OOXMLDocumentObject show all
Defined in:
lib/ooxml_parser/xlsx_parser/workbook/pivot_cache/pivot_cache_definition/cache_fields/cache_field/shared_items.rb

Overview

Class for parsing <sharedItems> tag

Instance Attribute Summary collapse

Attributes inherited from OOXMLDocumentObject

#parent

Instance Method Summary collapse

Methods inherited from OOXMLDocumentObject

#==, #boolean_attribute_value, #initialize, #parse_xml, #with_data?

Methods included from OoxmlObjectAttributeHelper

#attribute_enabled?, #option_enabled?

Methods included from OoxmlDocumentObjectHelper

#to_hash

Constructor Details

This class inherits a constructor from OoxmlParser::OOXMLDocumentObject

Instance Attribute Details

#contains_integerTrue, False (readonly)

Returns is contains_integer.

Returns:

  • (True, False)

    is contains_integer



13
14
15
# File 'lib/ooxml_parser/xlsx_parser/workbook/pivot_cache/pivot_cache_definition/cache_fields/cache_field/shared_items.rb', line 13

def contains_integer
  @contains_integer
end

#contains_numberTrue, False (readonly)

Returns is contains_number.

Returns:

  • (True, False)

    is contains_number



11
12
13
# File 'lib/ooxml_parser/xlsx_parser/workbook/pivot_cache/pivot_cache_definition/cache_fields/cache_field/shared_items.rb', line 11

def contains_number
  @contains_number
end

#contains_semi_mixed_typesTrue, False (readonly)

Returns is contains_semi_mixed_types.

Returns:

  • (True, False)

    is contains_semi_mixed_types



7
8
9
# File 'lib/ooxml_parser/xlsx_parser/workbook/pivot_cache/pivot_cache_definition/cache_fields/cache_field/shared_items.rb', line 7

def contains_semi_mixed_types
  @contains_semi_mixed_types
end

#contains_stringTrue, False (readonly)

Returns is contains_string.

Returns:

  • (True, False)

    is contains_string



9
10
11
# File 'lib/ooxml_parser/xlsx_parser/workbook/pivot_cache/pivot_cache_definition/cache_fields/cache_field/shared_items.rb', line 9

def contains_string
  @contains_string
end

#max_valueInteger (readonly)

Returns max value.

Returns:

  • (Integer)

    max value



17
18
19
# File 'lib/ooxml_parser/xlsx_parser/workbook/pivot_cache/pivot_cache_definition/cache_fields/cache_field/shared_items.rb', line 17

def max_value
  @max_value
end

#min_valueInteger (readonly)

Returns min value.

Returns:

  • (Integer)

    min value



15
16
17
# File 'lib/ooxml_parser/xlsx_parser/workbook/pivot_cache/pivot_cache_definition/cache_fields/cache_field/shared_items.rb', line 15

def min_value
  @min_value
end

Instance Method Details

#parse(node) ⇒ sharedItems

Parse ‘<sharedItems>` tag # @param [Nokogiri::XML:Element] node with WorksheetSource data

Returns:

  • (sharedItems)


22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/ooxml_parser/xlsx_parser/workbook/pivot_cache/pivot_cache_definition/cache_fields/cache_field/shared_items.rb', line 22

def parse(node)
  node.attributes.each do |key, value|
    case key
    when 'containsSemiMixedTypes'
      @contains_semi_mixed_types = attribute_enabled?(value)
    when 'containsString'
      @contains_string = attribute_enabled?(value)
    when 'containsNumber'
      @contains_number = attribute_enabled?(value)
    when 'containsInteger'
      @contains_integer = attribute_enabled?(value)
    when 'minValue'
      @min_value = value.value.to_i
    when 'maxValue'
      @max_value = value.value.to_i
    end
  end
  self
end