Class: OoxmlParser::XlsxDrawingPosition

Inherits:
Object
  • Object
show all
Defined in:
lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_drawing/xlsx_drawing_position.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#fromObject

Returns the value of attribute from.



4
5
6
# File 'lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_drawing/xlsx_drawing_position.rb', line 4

def from
  @from
end

#toObject

Returns the value of attribute to.



4
5
6
# File 'lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_drawing/xlsx_drawing_position.rb', line 4

def to
  @to
end

Class Method Details

.parse(node) ⇒ XlsxDrawingPosition

Parse XlsxDrawingPosition

Parameters:

  • node (Nokogiri::XML::Element)

    node to parse

Returns:



9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_drawing/xlsx_drawing_position.rb', line 9

def self.parse(node)
  position = XlsxDrawingPosition.new
  node.xpath('*').each do |drawing_node_child|
    case drawing_node_child.name
    when 'from'
      position.from = XlsxDrawingPositionParameters.parse(drawing_node_child)
    when 'to'
      position.to = XlsxDrawingPositionParameters.parse(drawing_node_child)
    end
  end
  position
end