Class: OoxmlParser::Location

Inherits:
OOXMLDocumentObject show all
Defined in:
lib/ooxml_parser/xlsx_parser/workbook/pivot_table_definition/location.rb

Overview

Class for parsing <location> 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

#first_data_columnInteger (readonly)

Returns first data column.

Returns:

  • (Integer)

    first data column



13
14
15
# File 'lib/ooxml_parser/xlsx_parser/workbook/pivot_table_definition/location.rb', line 13

def first_data_column
  @first_data_column
end

#first_data_rowInteger (readonly)

Returns first data row.

Returns:

  • (Integer)

    first data row



11
12
13
# File 'lib/ooxml_parser/xlsx_parser/workbook/pivot_table_definition/location.rb', line 11

def first_data_row
  @first_data_row
end

#first_header_rowInteger (readonly)

Returns first header row.

Returns:

  • (Integer)

    first header row



9
10
11
# File 'lib/ooxml_parser/xlsx_parser/workbook/pivot_table_definition/location.rb', line 9

def first_header_row
  @first_header_row
end

#refString (readonly)

Returns ref of location.

Returns:

  • (String)

    ref of location



7
8
9
# File 'lib/ooxml_parser/xlsx_parser/workbook/pivot_table_definition/location.rb', line 7

def ref
  @ref
end

Instance Method Details

#parse(node) ⇒ Location

Parse ‘<location>` tag

Parameters:

  • node (Nokogiri::XML:Element)

    with location data

Returns:



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/ooxml_parser/xlsx_parser/workbook/pivot_table_definition/location.rb', line 18

def parse(node)
  node.attributes.each do |key, value|
    case key
    when 'ref'
      @ref = value.value.to_s
    when 'firstHeaderRow'
      @first_header_row = value.value.to_i
    when 'firstDataRow'
      @first_data_row = value.value.to_i
    when 'firstDataCol'
      @first_data_column = value.value.to_i
    end
  end
  self
end