Class: OoxmlParser::FrameProperties

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

Instance Attribute Summary collapse

Attributes inherited from OOXMLDocumentObject

#parent

Instance Method Summary collapse

Methods inherited from OOXMLDocumentObject

#==, add_to_xmls_stack, copy_file_and_rename_to_zip, current_xml, dir, encrypted_file?, get_link_from_rels, #initialize, unzip_file, #with_data?

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.



3
4
5
# File 'lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/frame_properties.rb', line 3

def anchor_lock
  @anchor_lock
end

#drop_capObject

Returns the value of attribute drop_cap.



3
4
5
# File 'lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/frame_properties.rb', line 3

def drop_cap
  @drop_cap
end

#heightObject

Returns the value of attribute height.



3
4
5
# File 'lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/frame_properties.rb', line 3

def height
  @height
end

#height_ruleObject

Returns the value of attribute height_rule.



3
4
5
# File 'lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/frame_properties.rb', line 3

def height_rule
  @height_rule
end

#horizontal_alignObject

Returns the value of attribute horizontal_align.



3
4
5
# File 'lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/frame_properties.rb', line 3

def horizontal_align
  @horizontal_align
end

#horizontal_anchorObject

Returns the value of attribute horizontal_anchor.



3
4
5
# File 'lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/frame_properties.rb', line 3

def horizontal_anchor
  @horizontal_anchor
end

#horizontal_positionObject

Returns the value of attribute horizontal_position.



3
4
5
# File 'lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/frame_properties.rb', line 3

def horizontal_position
  @horizontal_position
end

#horizontal_spaceObject

Returns the value of attribute horizontal_space.



3
4
5
# File 'lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/frame_properties.rb', line 3

def horizontal_space
  @horizontal_space
end

#linesObject

Returns the value of attribute lines.



3
4
5
# File 'lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/frame_properties.rb', line 3

def lines
  @lines
end

#vertical_alignObject

Returns the value of attribute vertical_align.



3
4
5
# File 'lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/frame_properties.rb', line 3

def vertical_align
  @vertical_align
end

#vertical_anchorObject

Returns the value of attribute vertical_anchor.



3
4
5
# File 'lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/frame_properties.rb', line 3

def vertical_anchor
  @vertical_anchor
end

#vertical_positionObject

Returns the value of attribute vertical_position.



3
4
5
# File 'lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/frame_properties.rb', line 3

def vertical_position
  @vertical_position
end

#vertical_spaceObject

Returns the value of attribute vertical_space.



3
4
5
# File 'lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/frame_properties.rb', line 3

def vertical_space
  @vertical_space
end

#widthObject

Returns the value of attribute width.



3
4
5
# File 'lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/frame_properties.rb', line 3

def width
  @width
end

#wrapObject

Returns the value of attribute wrap.



3
4
5
# File 'lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/frame_properties.rb', line 3

def wrap
  @wrap
end

Instance Method Details

#parse(node) ⇒ Object



7
8
9
10
11
12
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
# File 'lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/frame_properties.rb', line 7

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