Class: Uniword::Wordprocessingml::Style
- Inherits:
-
Lutaml::Model::Serializable
- Object
- Lutaml::Model::Serializable
- Uniword::Wordprocessingml::Style
- Defined in:
- lib/uniword/wordprocessingml/style.rb
Overview
Style definition
Generated from OOXML schema: wordprocessingml.yml Element: <w:style>
Instance Method Summary collapse
- #alignment ⇒ Object
- #based_on ⇒ Object
- #bold ⇒ Object
- #character_style? ⇒ Boolean
- #custom? ⇒ Boolean
- #font_color ⇒ Object
- #font_color_theme ⇒ Object
- #font_color_theme_tint ⇒ Object
- #font_family ⇒ Object
- #font_size ⇒ Object
-
#id ⇒ Object
Convenience read-only accessors (aliases for lutaml-model attributes).
- #keep_lines ⇒ Object
- #keep_next ⇒ Object
- #linked_style ⇒ Object
- #next_style ⇒ Object
- #numbering_style? ⇒ Boolean
- #outline_level ⇒ Object
- #paragraph_properties ⇒ Object
- #paragraph_style? ⇒ Boolean
- #quick_format ⇒ Object
- #run_properties ⇒ Object
- #spacing_after ⇒ Object
- #spacing_before ⇒ Object
- #style_name ⇒ Object
- #table_style? ⇒ Boolean
- #ui_priority ⇒ Object
- #yaml_based_on_from(instance, value) ⇒ Object
- #yaml_based_on_to(instance, _doc) ⇒ Object
- #yaml_linked_style_from(instance, value) ⇒ Object
- #yaml_linked_style_to(instance, _doc) ⇒ Object
-
#yaml_name_from(instance, value) ⇒ Object
YAML transform methods (instance methods called by lutaml-model's
with:transform mechanism). - #yaml_name_to(instance, _doc) ⇒ Object
- #yaml_next_style_from(instance, value) ⇒ Object
- #yaml_next_style_to(instance, _doc) ⇒ Object
- #yaml_quick_format_from(instance, value) ⇒ Object
- #yaml_quick_format_to(instance, _doc) ⇒ Object
- #yaml_ui_priority_from(instance, value) ⇒ Object
- #yaml_ui_priority_to(instance, _doc) ⇒ Object
Instance Method Details
#alignment ⇒ Object
170 171 172 |
# File 'lib/uniword/wordprocessingml/style.rb', line 170 def alignment pPr&.alignment end |
#based_on ⇒ Object
138 139 140 |
# File 'lib/uniword/wordprocessingml/style.rb', line 138 def based_on basedOn&.val end |
#bold ⇒ Object
202 203 204 205 206 207 208 209 210 |
# File 'lib/uniword/wordprocessingml/style.rb', line 202 def bold return nil unless rPr val = rPr.bold return nil if val.nil? val = val.value if val.is_a?(Uniword::Properties::BooleanElement) val == true end |
#character_style? ⇒ Boolean
236 237 238 |
# File 'lib/uniword/wordprocessingml/style.rb', line 236 def character_style? type == "character" end |
#custom? ⇒ Boolean
228 229 230 |
# File 'lib/uniword/wordprocessingml/style.rb', line 228 def custom? customStyle == true end |
#font_color ⇒ Object
216 217 218 |
# File 'lib/uniword/wordprocessingml/style.rb', line 216 def font_color rPr&.color&.value end |
#font_color_theme ⇒ Object
220 221 222 |
# File 'lib/uniword/wordprocessingml/style.rb', line 220 def font_color_theme rPr&.color&.theme_color end |
#font_color_theme_tint ⇒ Object
224 225 226 |
# File 'lib/uniword/wordprocessingml/style.rb', line 224 def font_color_theme_tint rPr&.color&.theme_shade || rPr&.color&.theme_tint end |
#font_family ⇒ Object
198 199 200 |
# File 'lib/uniword/wordprocessingml/style.rb', line 198 def font_family rPr&.fonts&.ascii || rPr&.font end |
#font_size ⇒ Object
212 213 214 |
# File 'lib/uniword/wordprocessingml/style.rb', line 212 def font_size rPr&.size&.value&.to_i end |
#id ⇒ Object
Convenience read-only accessors (aliases for lutaml-model attributes)
130 131 132 |
# File 'lib/uniword/wordprocessingml/style.rb', line 130 def id styleId end |
#keep_lines ⇒ Object
184 185 186 187 188 189 190 191 192 |
# File 'lib/uniword/wordprocessingml/style.rb', line 184 def keep_lines return false unless pPr val = pPr.keep_lines_wrapper return false if val.nil? val = val.value if val.is_a?(Uniword::Properties::BooleanElement) val == true end |
#keep_next ⇒ Object
174 175 176 177 178 179 180 181 182 |
# File 'lib/uniword/wordprocessingml/style.rb', line 174 def keep_next return false unless pPr val = pPr.keep_next_wrapper return false if val.nil? val = val.value if val.is_a?(Uniword::Properties::BooleanElement) val == true end |
#linked_style ⇒ Object
146 147 148 |
# File 'lib/uniword/wordprocessingml/style.rb', line 146 def linked_style link&.val end |
#next_style ⇒ Object
142 143 144 |
# File 'lib/uniword/wordprocessingml/style.rb', line 142 def next_style nextStyle&.val end |
#numbering_style? ⇒ Boolean
244 245 246 |
# File 'lib/uniword/wordprocessingml/style.rb', line 244 def numbering_style? type == "numbering" end |
#outline_level ⇒ Object
194 195 196 |
# File 'lib/uniword/wordprocessingml/style.rb', line 194 def outline_level pPr&.outline_level&.value&.to_i end |
#paragraph_properties ⇒ Object
248 249 250 |
# File 'lib/uniword/wordprocessingml/style.rb', line 248 def paragraph_properties pPr end |
#paragraph_style? ⇒ Boolean
232 233 234 |
# File 'lib/uniword/wordprocessingml/style.rb', line 232 def paragraph_style? type == "paragraph" end |
#quick_format ⇒ Object
154 155 156 157 158 159 160 |
# File 'lib/uniword/wordprocessingml/style.rb', line 154 def quick_format val = qFormat return true if val == true val = val.value if val.is_a?(Uniword::Properties::BooleanElement) val == true end |
#run_properties ⇒ Object
252 253 254 |
# File 'lib/uniword/wordprocessingml/style.rb', line 252 def run_properties rPr end |
#spacing_after ⇒ Object
166 167 168 |
# File 'lib/uniword/wordprocessingml/style.rb', line 166 def spacing_after pPr&.spacing&.after || pPr&.spacing_after end |
#spacing_before ⇒ Object
162 163 164 |
# File 'lib/uniword/wordprocessingml/style.rb', line 162 def spacing_before pPr&.spacing&.before || pPr&.spacing_before end |
#style_name ⇒ Object
134 135 136 |
# File 'lib/uniword/wordprocessingml/style.rb', line 134 def style_name @name&.val end |
#table_style? ⇒ Boolean
240 241 242 |
# File 'lib/uniword/wordprocessingml/style.rb', line 240 def table_style? type == "table" end |
#ui_priority ⇒ Object
150 151 152 |
# File 'lib/uniword/wordprocessingml/style.rb', line 150 def ui_priority uiPriority&.val&.to_i end |
#yaml_based_on_from(instance, value) ⇒ Object
70 71 72 |
# File 'lib/uniword/wordprocessingml/style.rb', line 70 def yaml_based_on_from(instance, value) instance.basedOn = BasedOn.new(val: value) if value end |
#yaml_based_on_to(instance, _doc) ⇒ Object
74 75 76 |
# File 'lib/uniword/wordprocessingml/style.rb', line 74 def yaml_based_on_to(instance, _doc) instance.basedOn&.val end |
#yaml_linked_style_from(instance, value) ⇒ Object
86 87 88 |
# File 'lib/uniword/wordprocessingml/style.rb', line 86 def yaml_linked_style_from(instance, value) instance.link = Link.new(val: value) if value end |
#yaml_linked_style_to(instance, _doc) ⇒ Object
90 91 92 |
# File 'lib/uniword/wordprocessingml/style.rb', line 90 def yaml_linked_style_to(instance, _doc) instance.link&.val end |
#yaml_name_from(instance, value) ⇒ Object
YAML transform methods (instance methods called by lutaml-model's
with: transform mechanism)
54 55 56 |
# File 'lib/uniword/wordprocessingml/style.rb', line 54 def yaml_name_from(instance, value) instance.name = StyleName.new(val: value) if value end |
#yaml_name_to(instance, _doc) ⇒ Object
58 59 60 |
# File 'lib/uniword/wordprocessingml/style.rb', line 58 def yaml_name_to(instance, _doc) instance.name&.val end |
#yaml_next_style_from(instance, value) ⇒ Object
78 79 80 |
# File 'lib/uniword/wordprocessingml/style.rb', line 78 def yaml_next_style_from(instance, value) instance.nextStyle = Next.new(val: value) if value end |
#yaml_next_style_to(instance, _doc) ⇒ Object
82 83 84 |
# File 'lib/uniword/wordprocessingml/style.rb', line 82 def yaml_next_style_to(instance, _doc) instance.nextStyle&.val end |
#yaml_quick_format_from(instance, value) ⇒ Object
62 63 64 |
# File 'lib/uniword/wordprocessingml/style.rb', line 62 def yaml_quick_format_from(instance, value) instance.qFormat = Properties::QuickFormat.new(value: value) unless value.nil? end |
#yaml_quick_format_to(instance, _doc) ⇒ Object
66 67 68 |
# File 'lib/uniword/wordprocessingml/style.rb', line 66 def yaml_quick_format_to(instance, _doc) instance.qFormat&.value end |
#yaml_ui_priority_from(instance, value) ⇒ Object
94 95 96 |
# File 'lib/uniword/wordprocessingml/style.rb', line 94 def yaml_ui_priority_from(instance, value) instance.uiPriority = UiPriority.new(val: value.to_s) if value end |
#yaml_ui_priority_to(instance, _doc) ⇒ Object
98 99 100 |
# File 'lib/uniword/wordprocessingml/style.rb', line 98 def yaml_ui_priority_to(instance, _doc) instance.uiPriority&.val&.to_i end |