Class: OoxmlParser::LineEnd

Inherits:
OOXMLDocumentObject show all
Defined in:
lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/line/line_end.rb

Constant Summary

Constants inherited from OOXMLDocumentObject

OOXMLDocumentObject::DEFAULT_DIRECTORY_FOR_MEDIA

Instance Attribute Summary collapse

Class Method Summary collapse

Methods inherited from OOXMLDocumentObject

#==, add_to_xmls_stack, copy_file_and_rename_to_zip, copy_media_file, current_xml, dir, encrypted_file?, get_link_from_rels, media_folder, option_enabled?, unzip_file

Instance Attribute Details

#lengthObject

Returns the value of attribute length.



4
5
6
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/line/line_end.rb', line 4

def length
  @length
end

#typeObject

Returns the value of attribute type.



4
5
6
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/line/line_end.rb', line 4

def type
  @type
end

#widthObject

Returns the value of attribute width.



4
5
6
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/line/line_end.rb', line 4

def width
  @width
end

Class Method Details

.parse(line_end_node) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/line/line_end.rb', line 6

def self.parse(line_end_node)
  line_end = LineEnd.new
  line_end_node.attributes.each do |key, value|
    case key
    when 'type'
      line_end.type = value.value.to_sym
    when 'w'
      line_end.width = LineSize.parse(value.value)
    when 'len'
      line_end.length = LineSize.parse(value.value)
    end
  end
  line_end
end