Class: OpenXml::Docx::Properties::PageBorders
- Inherits:
-
ComplexProperty
- Object
- BaseProperty
- ComplexProperty
- OpenXml::Docx::Properties::PageBorders
- Defined in:
- lib/openxml/docx/properties/page_borders.rb
Constant Summary collapse
- VALID_DISPLAYS =
i(allPages firstPage notFirstPage)
- VALID_OFFSETS =
i(page text)
- VALID_Z_ORDERS =
i(front back)
Constants included from AttributeBuilder
AttributeBuilder::VALID_THEME_COLORS, AttributeBuilder::VALID_TYPES
Instance Attribute Summary collapse
-
#bottom ⇒ Object
readonly
Returns the value of attribute bottom.
-
#left ⇒ Object
readonly
Returns the value of attribute left.
-
#right ⇒ Object
readonly
Returns the value of attribute right.
-
#top ⇒ Object
readonly
Returns the value of attribute top.
Attributes inherited from BaseProperty
Instance Method Summary collapse
-
#initialize ⇒ PageBorders
constructor
A new instance of PageBorders.
- #render? ⇒ Boolean
- #to_xml(xml) ⇒ Object
Methods included from AttributeBuilder
Methods inherited from BaseProperty
#default_name, #default_tag, name, #name, tag, #tag
Constructor Details
#initialize ⇒ PageBorders
Returns a new instance of PageBorders.
12 13 14 15 16 17 |
# File 'lib/openxml/docx/properties/page_borders.rb', line 12 def initialize @left = new_border :left @right = new_border :right @top = new_border :top @bottom = new_border :bottom end |
Instance Attribute Details
#bottom ⇒ Object (readonly)
Returns the value of attribute bottom.
5 6 7 |
# File 'lib/openxml/docx/properties/page_borders.rb', line 5 def bottom @bottom end |
#left ⇒ Object (readonly)
Returns the value of attribute left.
5 6 7 |
# File 'lib/openxml/docx/properties/page_borders.rb', line 5 def left @left end |
#right ⇒ Object (readonly)
Returns the value of attribute right.
5 6 7 |
# File 'lib/openxml/docx/properties/page_borders.rb', line 5 def right @right end |
#top ⇒ Object (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
19 20 21 |
# File 'lib/openxml/docx/properties/page_borders.rb', line 19 def render? renderable_borders.any? end |
#to_xml(xml) ⇒ Object
23 24 25 26 |
# File 'lib/openxml/docx/properties/page_borders.rb', line 23 def to_xml(xml) return unless render? xml["w"].public_send(tag, xml_attributes) { render_borders_xml(xml) } end |