Class: Goldendocx::Components::Text
- Inherits:
-
Object
- Object
- Goldendocx::Components::Text
show all
- Includes:
- Element
- Defined in:
- lib/goldendocx/components/text.rb
Instance Method Summary
collapse
Methods included from Element
#build_element, #initialize, #namespace, #tag, #tag_name, #to_element, #to_xml
#children, #read_child, #read_children
#assign_attributes, #attributes, #read_attributes
Instance Method Details
#align=(align) ⇒ Object
14
15
16
|
# File 'lib/goldendocx/components/text.rb', line 14
def align=(align)
property.align.align = align if align
end
|
#bold=(bold) ⇒ Object
30
31
32
|
# File 'lib/goldendocx/components/text.rb', line 30
def bold=(bold)
(run.property || run.build_property).build_bold(enabled: bold) if bold
end
|
#color=(color_hex) ⇒ Object
26
27
28
|
# File 'lib/goldendocx/components/text.rb', line 26
def color=(color_hex)
(run.property || run.build_property).build_color(hex: color_hex) if color_hex
end
|
#style=(style) ⇒ Object
18
19
20
|
# File 'lib/goldendocx/components/text.rb', line 18
def style=(style)
property.style.style_id = style if style
end
|
#text=(text) ⇒ Object
22
23
24
|
# File 'lib/goldendocx/components/text.rb', line 22
def text=(text)
run.build_text.value = text if text
end
|