Class: OoxmlParser::FrameProperties

Inherits:
OOXMLDocumentObject show all
Defined in:
lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/frame_properties.rb

Overview

Class for data with FrameProperties

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

#anchor_lockObject

Returns the value of attribute anchor_lock.



6
7
8
# File 'lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/frame_properties.rb', line 6

def anchor_lock
  @anchor_lock
end

#drop_capObject

Returns the value of attribute drop_cap.



6
7
8
# File 'lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/frame_properties.rb', line 6

def drop_cap
  @drop_cap
end

#heightObject

Returns the value of attribute height.



6
7
8
# File 'lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/frame_properties.rb', line 6

def height
  @height
end

#height_ruleObject

Returns the value of attribute height_rule.



6
7
8
# File 'lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/frame_properties.rb', line 6

def height_rule
  @height_rule
end

#horizontal_alignObject

Returns the value of attribute horizontal_align.



6
7
8
# File 'lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/frame_properties.rb', line 6

def horizontal_align
  @horizontal_align
end

#horizontal_anchorObject

Returns the value of attribute horizontal_anchor.



6
7
8
# File 'lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/frame_properties.rb', line 6

def horizontal_anchor
  @horizontal_anchor
end

#horizontal_positionObject

Returns the value of attribute horizontal_position.



6
7
8
# File 'lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/frame_properties.rb', line 6

def horizontal_position
  @horizontal_position
end

#horizontal_spaceObject

Returns the value of attribute horizontal_space.



6
7
8
# File 'lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/frame_properties.rb', line 6

def horizontal_space
  @horizontal_space
end

#linesObject

Returns the value of attribute lines.



6
7
8
# File 'lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/frame_properties.rb', line 6

def lines
  @lines
end

#vertical_alignObject

Returns the value of attribute vertical_align.



6
7
8
# File 'lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/frame_properties.rb', line 6

def vertical_align
  @vertical_align
end

#vertical_anchorObject

Returns the value of attribute vertical_anchor.



6
7
8
# File 'lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/frame_properties.rb', line 6

def vertical_anchor
  @vertical_anchor
end

#vertical_positionObject

Returns the value of attribute vertical_position.



6
7
8
# File 'lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/frame_properties.rb', line 6

def vertical_position
  @vertical_position
end

#vertical_spaceObject

Returns the value of attribute vertical_space.



6
7
8
# File 'lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/frame_properties.rb', line 6

def vertical_space
  @vertical_space
end

#widthObject

Returns the value of attribute width.



6
7
8
# File 'lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/frame_properties.rb', line 6

def width
  @width
end

#wrapObject

Returns the value of attribute wrap.



6
7
8
# File 'lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/frame_properties.rb', line 6

def wrap
  @wrap
end

Instance Method Details

#parse(node) ⇒ FrameProperties

Parse FrameProperties

Parameters:

  • node (Nokogiri::XML:Element)

    with FrameProperties

Returns:



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/frame_properties.rb', line 13

def parse(node)
  node.attributes.each do |key, value|
    case key
    when 'dropCap'
      @drop_cap = value.value.to_sym
    when 'lines'
      @lines = value.value.to_i
    when 'wrap'
      @lines = value.value.to_sym
    when 'vAnchor'
      @vertical_anchor = value.value.to_sym
    when 'hAnchor'
      @horizontal_anchor = value.value.to_sym
    when 'w'
      @width = OoxmlSize.new(value.value.to_f)
    when 'h'
      @height = OoxmlSize.new(value.value.to_f)
    when 'hRule'
      @height_rule = value.value.to_s.sub('atLeast', 'at_least').to_sym
    when 'xAlign'
      @horizontal_align = value.value.to_sym
    when 'yAlign'
      @vertical_align = value.value.to_sym
    when 'anchorLock'
      @anchor_lock = attribute_enabled?(value)
    when 'vSpace'
      @vertical_space = OoxmlSize.new(value.value.to_f)
    when 'hSpace'
      @horizontal_space = OoxmlSize.new(value.value.to_f)
    when 'x'
      @horizontal_position = OoxmlSize.new(value.value.to_f)
    when 'y'
      @vertical_position = OoxmlSize.new(value.value.to_f)
    end
  end
  self
end