Class: OpenXml::Docx::Properties::PageBorders

Inherits:
ComplexProperty show all
Defined in:
lib/openxml/docx/properties/page_borders.rb

Instance Attribute Summary collapse

Attributes inherited from BaseProperty

#value

Instance Method Summary collapse

Methods inherited from BaseProperty

#default_name, #default_namespace, #default_tag, #name, name, namespace, #namespace, #tag, tag, tag_is_one_of

Constructor Details

#initializePageBorders

Returns a new instance of PageBorders.



15
16
17
18
19
20
# File 'lib/openxml/docx/properties/page_borders.rb', line 15

def initialize
  @left = new_border :left
  @right = new_border :right
  @top = new_border :top
  @bottom = new_border :bottom
end

Instance Attribute Details

#bottomObject (readonly)

Returns the value of attribute bottom.



5
6
7
# File 'lib/openxml/docx/properties/page_borders.rb', line 5

def bottom
  @bottom
end

#leftObject (readonly)

Returns the value of attribute left.



5
6
7
# File 'lib/openxml/docx/properties/page_borders.rb', line 5

def left
  @left
end

#rightObject (readonly)

Returns the value of attribute right.



5
6
7
# File 'lib/openxml/docx/properties/page_borders.rb', line 5

def right
  @right
end

#topObject (readonly)

Returns the value of attribute top.



5
6
7
# File 'lib/openxml/docx/properties/page_borders.rb', line 5

def top
  @top
end

Instance Method Details

#render?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/openxml/docx/properties/page_borders.rb', line 22

def render?
  renderable_borders.any?
end

#to_xml(xml) ⇒ Object



26
27
28
29
# File 'lib/openxml/docx/properties/page_borders.rb', line 26

def to_xml(xml)
  return unless render?
  xml["w"].public_send(tag, xml_attributes) { render_borders_xml(xml) }
end