Sha256: dc6d8adf11d657d4fa32a1bc9330f66dc685e8c05e3962105432eba1d9e24fd1

Contents?: true

Size: 847 Bytes

Versions: 4

Compression:

Stored size: 847 Bytes

Contents

module OoxmlParser
  # Class for parsing offset of drawing `xdr:from`, `xdr:to`
  class XlsxDrawingPositionParameters < OOXMLDocumentObject
    attr_accessor :column, :column_offset, :row, :row_offset

    # Parse XlsxDrawingPositionParameters object
    # @param node [Nokogiri::XML:Element] node to parse
    # @return [XlsxDrawingPositionParameters] result of parsing
    def parse(node)
      node.xpath('*').each do |node_child|
        case node_child.name
        when 'col'
          @column = Coordinates.get_column_name(node_child.text.to_i + 1)
        when 'colOff'
          @column_offset = OoxmlSize.new(node_child.text.to_f, :emu)
        when 'row'
          @row = node_child.text.to_i + 1
        when 'rowOff'
          @row_offset = OoxmlSize.new(node_child.text.to_f, :emu)
        end
      end
      self
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ooxml_parser-0.4.1 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_drawing/xlsx_drawing_position_parameters.rb
ooxml_parser-0.4.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_drawing/xlsx_drawing_position_parameters.rb
ooxml_parser-0.3.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_drawing/xlsx_drawing_position_parameters.rb
ooxml_parser-0.2.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_drawing/xlsx_drawing_position_parameters.rb