Class: Goldendocx::Components::Text

Inherits:
Object
  • Object
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

Methods included from HasChildren

#children, #read_child, #read_children

Methods included from HasAttributes

#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