Class: OpenXml::Docx::Properties::PageBorders
- Inherits:
-
ComplexProperty
- Object
- BaseProperty
- ComplexProperty
- OpenXml::Docx::Properties::PageBorders
- Defined in:
- lib/openxml/docx/properties/page_borders.rb
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 inherited from BaseProperty
#default_name, #default_namespace, #default_tag, #name, name, namespace, #namespace, #tag, tag, tag_is_one_of
Constructor Details
#initialize ⇒ PageBorders
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
#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
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 |