rrtf 1.0.0 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/CHANGELOG.md +17 -0
- data/README.md +29 -0
- data/documentation/RRTF.html +5 -5
- data/documentation/RRTF/AnonymousStyle.html +2 -2
- data/documentation/RRTF/BorderFormatting.html +48 -48
- data/documentation/RRTF/BorderStyle.html +1 -1
- data/documentation/RRTF/CharacterFormatting.html +1 -1
- data/documentation/RRTF/CharacterStyle.html +1 -1
- data/documentation/RRTF/Colour.html +1 -1
- data/documentation/RRTF/ColourTable.html +1 -1
- data/documentation/RRTF/CommandNode.html +333 -93
- data/documentation/RRTF/ContainerNode.html +1 -1
- data/documentation/RRTF/Converters.html +1 -1
- data/documentation/RRTF/Converters/HTML.html +1 -1
- data/documentation/RRTF/Converters/HTML/Helpers.html +1 -1
- data/documentation/RRTF/Converters/HTML/Node.html +1 -1
- data/documentation/RRTF/Converters/HTML/NodeSet.html +1 -1
- data/documentation/RRTF/Document.html +2 -2
- data/documentation/RRTF/DocumentFormatting.html +48 -48
- data/documentation/RRTF/DocumentProperties.html +8 -3
- data/documentation/RRTF/Font.html +1 -1
- data/documentation/RRTF/FontTable.html +1 -1
- data/documentation/RRTF/FooterNode.html +2 -2
- data/documentation/RRTF/GeometryNode.html +2 -2
- data/documentation/RRTF/GeometryProperties.html +9 -9
- data/documentation/RRTF/HeaderNode.html +2 -2
- data/documentation/RRTF/ImageNode.html +64 -61
- data/documentation/RRTF/Information.html +1 -1
- data/documentation/RRTF/LinkNode.html +2 -2
- data/documentation/RRTF/ListLevel.html +1 -1
- data/documentation/RRTF/ListLevelNode.html +2 -2
- data/documentation/RRTF/ListMarker.html +1 -1
- data/documentation/RRTF/ListNode.html +2 -2
- data/documentation/RRTF/ListTable.html +1 -1
- data/documentation/RRTF/ListTemplate.html +1 -1
- data/documentation/RRTF/ListTextNode.html +2 -2
- data/documentation/RRTF/Node.html +1 -1
- data/documentation/RRTF/Page.html +1 -1
- data/documentation/RRTF/Page/Margin.html +1 -1
- data/documentation/RRTF/Page/Size.html +1 -1
- data/documentation/RRTF/PageFormatting.html +184 -195
- data/documentation/RRTF/ParagraphFormatting.html +75 -48
- data/documentation/RRTF/ParagraphNode.html +2 -2
- data/documentation/RRTF/ParagraphStyle.html +1 -1
- data/documentation/RRTF/PositionFormatting.html +48 -48
- data/documentation/RRTF/PositionStyle.html +1 -1
- data/documentation/RRTF/Properties.html +1 -1
- data/documentation/RRTF/RTFError.html +1 -1
- data/documentation/RRTF/SectionFormatting.html +750 -0
- data/documentation/RRTF/SectionNode.html +383 -0
- data/documentation/RRTF/SectionStyle.html +830 -0
- data/documentation/RRTF/ShadingFormatting.html +48 -48
- data/documentation/RRTF/ShadingStyle.html +1 -1
- data/documentation/RRTF/Style.html +2 -2
- data/documentation/RRTF/Stylesheet.html +1 -1
- data/documentation/RRTF/TabStyle.html +698 -0
- data/documentation/RRTF/TableCellNode.html +2 -2
- data/documentation/RRTF/TableNode.html +1 -1
- data/documentation/RRTF/TableRowNode.html +1 -1
- data/documentation/RRTF/TextNode.html +1 -1
- data/documentation/RRTF/Utilities.html +1 -1
- data/documentation/_index.html +33 -5
- data/documentation/class_list.html +1 -1
- data/documentation/file.README.html +32 -1
- data/documentation/index.html +32 -1
- data/documentation/method_list.html +499 -355
- data/documentation/top-level-namespace.html +1 -1
- data/examples/08.rtf +2 -2
- data/examples/09.rtf +9 -13
- data/examples/09_shapes.rb +2 -1
- data/examples/11.rtf +19 -0
- data/examples/11_sections.rb +11 -0
- data/examples/12.rtf +19 -0
- data/examples/12_tabs.rb +21 -0
- data/lib/rrtf/formatting.rb +155 -22
- data/lib/rrtf/node.rb +1 -0
- data/lib/rrtf/node/command_node.rb +38 -4
- data/lib/rrtf/node/image_node.rb +26 -32
- data/lib/rrtf/node/section_node.rb +21 -0
- data/lib/rrtf/properties/geometry_properties.rb +4 -4
- data/lib/rrtf/style.rb +2 -0
- data/lib/rrtf/style/section_style.rb +66 -0
- data/lib/rrtf/style/tab_style.rb +55 -0
- data/lib/rrtf/version.rb +1 -1
- data/rrtf.gemspec +4 -4
- metadata +30 -20
@@ -304,6 +304,33 @@ user, and (3) how to convert the attribute to an RTF sequence.
|
|
304
304
|
<span class='kw'>end</span> <span class='comment'># case
|
305
305
|
</span> <span class='kw'>end</span><span class='comma'>,</span>
|
306
306
|
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>to_rtf</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='id identifier rubyid_lambda'>lambda</span><span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='id identifier rubyid_document'>document</span><span class='op'>|</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_rtf_formatting'>rtf_formatting</span><span class='lparen'>(</span><span class='id identifier rubyid_document'>document</span><span class='rparen'>)</span> <span class='kw'>unless</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='rbrace'>}</span>
|
307
|
+
<span class='rbrace'>}</span><span class='comma'>,</span>
|
308
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>tabs</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='lbrace'>{</span>
|
309
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>default</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='kw'>nil</span><span class='comma'>,</span>
|
310
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>from_user</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='id identifier rubyid_lambda'>lambda</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_value'>value</span><span class='op'>|</span>
|
311
|
+
<span class='kw'>case</span> <span class='id identifier rubyid_value'>value</span>
|
312
|
+
<span class='kw'>when</span> <span class='const'>Array</span>
|
313
|
+
<span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_collect'>collect</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_t'>t</span><span class='op'>|</span>
|
314
|
+
<span class='kw'>case</span> <span class='id identifier rubyid_t'>t</span>
|
315
|
+
<span class='kw'>when</span> <span class='const'>Hash</span>
|
316
|
+
<span class='const'><span class='object_link'><a href="../RRTF.html" title="RRTF (module)">RRTF</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="TabStyle.html" title="RRTF::TabStyle (class)">TabStyle</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="TabStyle.html#initialize-instance_method" title="RRTF::TabStyle#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_t'>t</span><span class='rparen'>)</span>
|
317
|
+
<span class='kw'>when</span> <span class='const'><span class='object_link'><a href="../RRTF.html" title="RRTF (module)">RRTF</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="TabStyle.html" title="RRTF::TabStyle (class)">TabStyle</a></span></span>
|
318
|
+
<span class='id identifier rubyid_t'>t</span>
|
319
|
+
<span class='kw'>else</span>
|
320
|
+
<span class='const'><span class='object_link'><a href="../RRTF.html" title="RRTF (module)">RRTF</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="RTFError.html" title="RRTF::RTFError (class)">RTFError</a></span></span><span class='period'>.</span><span class='id identifier rubyid_fire'><span class='object_link'><a href="RTFError.html#fire-class_method" title="RRTF::RTFError.fire (method)">fire</a></span></span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Invalid tab '</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_t'>t</span><span class='embexpr_end'>}</span><span class='tstring_content'>'.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
321
|
+
<span class='kw'>end</span> <span class='comment'># case
|
322
|
+
</span> <span class='kw'>end</span> <span class='comment'># collect
|
323
|
+
</span> <span class='kw'>when</span> <span class='const'>Hash</span>
|
324
|
+
<span class='lbracket'>[</span><span class='const'><span class='object_link'><a href="../RRTF.html" title="RRTF (module)">RRTF</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="TabStyle.html" title="RRTF::TabStyle (class)">TabStyle</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="TabStyle.html#initialize-instance_method" title="RRTF::TabStyle#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span><span class='rbracket'>]</span>
|
325
|
+
<span class='kw'>when</span> <span class='const'><span class='object_link'><a href="../RRTF.html" title="RRTF (module)">RRTF</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="TabStyle.html" title="RRTF::TabStyle (class)">TabStyle</a></span></span>
|
326
|
+
<span class='lbracket'>[</span><span class='id identifier rubyid_value'>value</span><span class='rbracket'>]</span>
|
327
|
+
<span class='kw'>else</span>
|
328
|
+
<span class='const'><span class='object_link'><a href="../RRTF.html" title="RRTF (module)">RRTF</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="RTFError.html" title="RRTF::RTFError (class)">RTFError</a></span></span><span class='period'>.</span><span class='id identifier rubyid_fire'><span class='object_link'><a href="RTFError.html#fire-class_method" title="RRTF::RTFError.fire (method)">fire</a></span></span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Invalid border '</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_value'>value</span><span class='embexpr_end'>}</span><span class='tstring_content'>'.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
329
|
+
<span class='kw'>end</span> <span class='comment'># case
|
330
|
+
</span> <span class='kw'>end</span><span class='comma'>,</span>
|
331
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>to_rtf</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='id identifier rubyid_lambda'>lambda</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='id identifier rubyid_document'>document</span><span class='op'>|</span>
|
332
|
+
<span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_collect'>collect</span><span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_tab'>tab</span><span class='op'>|</span> <span class='id identifier rubyid_tab'>tab</span><span class='period'>.</span><span class='id identifier rubyid_rtf_formatting'>rtf_formatting</span> <span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'> </span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='kw'>unless</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
333
|
+
<span class='kw'>end</span>
|
307
334
|
<span class='rbrace'>}</span>
|
308
335
|
<span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span></pre></dd>
|
309
336
|
|
@@ -481,17 +508,17 @@ is included in another module or class.
|
|
481
508
|
<pre class="lines">
|
482
509
|
|
483
510
|
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
511
|
+
367
|
512
|
+
368
|
513
|
+
369
|
514
|
+
370
|
515
|
+
371
|
516
|
+
372
|
517
|
+
373
|
518
|
+
374</pre>
|
492
519
|
</td>
|
493
520
|
<td>
|
494
|
-
<pre class="code"><span class="info file"># File 'lib/rrtf/formatting.rb', line
|
521
|
+
<pre class="code"><span class="info file"># File 'lib/rrtf/formatting.rb', line 367</span>
|
495
522
|
|
496
523
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_included'>included</span><span class='lparen'>(</span><span class='id identifier rubyid_base'>base</span><span class='rparen'>)</span>
|
497
524
|
<span class='comment'># define accessors in base for paragraph attributes
|
@@ -798,17 +825,17 @@ page (i.e. without breaking).
|
|
798
825
|
<pre class="lines">
|
799
826
|
|
800
827
|
|
801
|
-
|
802
|
-
|
803
|
-
|
804
|
-
|
805
|
-
|
806
|
-
|
807
|
-
|
808
|
-
|
828
|
+
392
|
829
|
+
393
|
830
|
+
394
|
831
|
+
395
|
832
|
+
396
|
833
|
+
397
|
834
|
+
398
|
835
|
+
399</pre>
|
809
836
|
</td>
|
810
837
|
<td>
|
811
|
-
<pre class="code"><span class="info file"># File 'lib/rrtf/formatting.rb', line
|
838
|
+
<pre class="code"><span class="info file"># File 'lib/rrtf/formatting.rb', line 392</span>
|
812
839
|
|
813
840
|
<span class='kw'>def</span> <span class='id identifier rubyid_initialize_paragraph_formatting'>initialize_paragraph_formatting</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
814
841
|
<span class='comment'># load default attribute values
|
@@ -895,22 +922,22 @@ be found in the document's colour and font tables, respectively.
|
|
895
922
|
<pre class="lines">
|
896
923
|
|
897
924
|
|
898
|
-
|
899
|
-
|
900
|
-
|
901
|
-
|
902
|
-
|
903
|
-
|
904
|
-
|
905
|
-
|
906
|
-
|
907
|
-
|
908
|
-
|
909
|
-
|
910
|
-
|
925
|
+
424
|
926
|
+
425
|
927
|
+
426
|
928
|
+
427
|
929
|
+
428
|
930
|
+
429
|
931
|
+
430
|
932
|
+
431
|
933
|
+
432
|
934
|
+
433
|
935
|
+
434
|
936
|
+
435
|
937
|
+
436</pre>
|
911
938
|
</td>
|
912
939
|
<td>
|
913
|
-
<pre class="code"><span class="info file"># File 'lib/rrtf/formatting.rb', line
|
940
|
+
<pre class="code"><span class="info file"># File 'lib/rrtf/formatting.rb', line 424</span>
|
914
941
|
|
915
942
|
<span class='kw'>def</span> <span class='id identifier rubyid_paragraph_formatting_to_rtf'>paragraph_formatting_to_rtf</span><span class='lparen'>(</span><span class='id identifier rubyid_document'>document</span><span class='rparen'>)</span>
|
916
943
|
<span class='id identifier rubyid_text'>text</span> <span class='op'>=</span> <span class='const'>StringIO</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
@@ -979,23 +1006,23 @@ be found in the document's colour and font tables, respectively.
|
|
979
1006
|
<pre class="lines">
|
980
1007
|
|
981
1008
|
|
982
|
-
|
983
|
-
|
984
|
-
|
985
|
-
|
986
|
-
|
987
|
-
|
988
|
-
|
989
|
-
|
990
|
-
|
991
|
-
|
992
|
-
|
993
|
-
|
994
|
-
|
995
|
-
|
1009
|
+
403
|
1010
|
+
404
|
1011
|
+
405
|
1012
|
+
406
|
1013
|
+
407
|
1014
|
+
408
|
1015
|
+
409
|
1016
|
+
410
|
1017
|
+
411
|
1018
|
+
412
|
1019
|
+
413
|
1020
|
+
414
|
1021
|
+
415
|
1022
|
+
416</pre>
|
996
1023
|
</td>
|
997
1024
|
<td>
|
998
|
-
<pre class="code"><span class="info file"># File 'lib/rrtf/formatting.rb', line
|
1025
|
+
<pre class="code"><span class="info file"># File 'lib/rrtf/formatting.rb', line 403</span>
|
999
1026
|
|
1000
1027
|
<span class='kw'>def</span> <span class='id identifier rubyid_set_paragraph_formatting_from_hashmap'>set_paragraph_formatting_from_hashmap</span><span class='lparen'>(</span><span class='id identifier rubyid_hash'>hash</span><span class='rparen'>)</span>
|
1001
1028
|
<span class='id identifier rubyid_hash'>hash</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_attribute'>attribute</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='op'>|</span>
|
@@ -1021,7 +1048,7 @@ be found in the document's colour and font tables, respectively.
|
|
1021
1048
|
</div>
|
1022
1049
|
|
1023
1050
|
<div id="footer">
|
1024
|
-
Generated on
|
1051
|
+
Generated on Wed Aug 2 23:05:15 2017 by
|
1025
1052
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1026
1053
|
0.9.9 (ruby-2.3.3).
|
1027
1054
|
</div>
|
@@ -185,7 +185,7 @@
|
|
185
185
|
|
186
186
|
|
187
187
|
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="CommandNode.html" title="RRTF::CommandNode (class)">CommandNode</a></span></h3>
|
188
|
-
<p class="inherited"><span class='object_link'><a href="CommandNode.html#<<-instance_method" title="RRTF::CommandNode#<< (method)">#<<</a></span>, <span class='object_link'><a href="CommandNode.html#apply-instance_method" title="RRTF::CommandNode#apply (method)">#apply</a></span>, <span class='object_link'><a href="CommandNode.html#footnote-instance_method" title="RRTF::CommandNode#footnote (method)">#footnote</a></span>, <span class='object_link'><a href="CommandNode.html#geometry-instance_method" title="RRTF::CommandNode#geometry (method)">#geometry</a></span>, <span class='object_link'><a href="CommandNode.html#image-instance_method" title="RRTF::CommandNode#image (method)">#image</a></span>, <span class='object_link'><a href="CommandNode.html#line_break-instance_method" title="RRTF::CommandNode#line_break (method)">#line_break</a></span>, <span class='object_link'><a href="CommandNode.html#link-instance_method" title="RRTF::CommandNode#link (method)">#link</a></span>, <span class='object_link'><a href="CommandNode.html#list-instance_method" title="RRTF::CommandNode#list (method)">#list</a></span>, <span class='object_link'><a href="CommandNode.html#paragraph-instance_method" title="RRTF::CommandNode#paragraph (method)">#paragraph</a></span>, <span class='object_link'><a href="CommandNode.html#table-instance_method" title="RRTF::CommandNode#table (method)">#table</a></span>, <span class='object_link'><a href="CommandNode.html#to_rtf-instance_method" title="RRTF::CommandNode#to_rtf (method)">#to_rtf</a></span></p>
|
188
|
+
<p class="inherited"><span class='object_link'><a href="CommandNode.html#<<-instance_method" title="RRTF::CommandNode#<< (method)">#<<</a></span>, <span class='object_link'><a href="CommandNode.html#apply-instance_method" title="RRTF::CommandNode#apply (method)">#apply</a></span>, <span class='object_link'><a href="CommandNode.html#column_break-instance_method" title="RRTF::CommandNode#column_break (method)">#column_break</a></span>, <span class='object_link'><a href="CommandNode.html#footnote-instance_method" title="RRTF::CommandNode#footnote (method)">#footnote</a></span>, <span class='object_link'><a href="CommandNode.html#geometry-instance_method" title="RRTF::CommandNode#geometry (method)">#geometry</a></span>, <span class='object_link'><a href="CommandNode.html#image-instance_method" title="RRTF::CommandNode#image (method)">#image</a></span>, <span class='object_link'><a href="CommandNode.html#line_break-instance_method" title="RRTF::CommandNode#line_break (method)">#line_break</a></span>, <span class='object_link'><a href="CommandNode.html#link-instance_method" title="RRTF::CommandNode#link (method)">#link</a></span>, <span class='object_link'><a href="CommandNode.html#list-instance_method" title="RRTF::CommandNode#list (method)">#list</a></span>, <span class='object_link'><a href="CommandNode.html#paragraph-instance_method" title="RRTF::CommandNode#paragraph (method)">#paragraph</a></span>, <span class='object_link'><a href="CommandNode.html#section-instance_method" title="RRTF::CommandNode#section (method)">#section</a></span>, <span class='object_link'><a href="CommandNode.html#tab-instance_method" title="RRTF::CommandNode#tab (method)">#tab</a></span>, <span class='object_link'><a href="CommandNode.html#table-instance_method" title="RRTF::CommandNode#table (method)">#table</a></span>, <span class='object_link'><a href="CommandNode.html#to_rtf-instance_method" title="RRTF::CommandNode#to_rtf (method)">#to_rtf</a></span></p>
|
189
189
|
|
190
190
|
|
191
191
|
|
@@ -265,7 +265,7 @@
|
|
265
265
|
</div>
|
266
266
|
|
267
267
|
<div id="footer">
|
268
|
-
Generated on
|
268
|
+
Generated on Wed Aug 2 23:05:18 2017 by
|
269
269
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
270
270
|
0.9.9 (ruby-2.3.3).
|
271
271
|
</div>
|
@@ -1270,7 +1270,7 @@ be nil if no colours used).
|
|
1270
1270
|
</div>
|
1271
1271
|
|
1272
1272
|
<div id="footer">
|
1273
|
-
Generated on
|
1273
|
+
Generated on Wed Aug 2 23:05:19 2017 by
|
1274
1274
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1275
1275
|
0.9.9 (ruby-2.3.3).
|
1276
1276
|
</div>
|
@@ -426,17 +426,17 @@ is included in another module or class.
|
|
426
426
|
<pre class="lines">
|
427
427
|
|
428
428
|
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
429
|
+
650
|
430
|
+
651
|
431
|
+
652
|
432
|
+
653
|
433
|
+
654
|
434
|
+
655
|
435
|
+
656
|
436
|
+
657</pre>
|
437
437
|
</td>
|
438
438
|
<td>
|
439
|
-
<pre class="code"><span class="info file"># File 'lib/rrtf/formatting.rb', line
|
439
|
+
<pre class="code"><span class="info file"># File 'lib/rrtf/formatting.rb', line 650</span>
|
440
440
|
|
441
441
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_included'>included</span><span class='lparen'>(</span><span class='id identifier rubyid_base'>base</span><span class='rparen'>)</span>
|
442
442
|
<span class='comment'># define accessors in base for position attributes
|
@@ -547,17 +547,17 @@ is included in another module or class.
|
|
547
547
|
<pre class="lines">
|
548
548
|
|
549
549
|
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
550
|
+
663
|
551
|
+
664
|
552
|
+
665
|
553
|
+
666
|
554
|
+
667
|
555
|
+
668
|
556
|
+
669
|
557
|
+
670</pre>
|
558
558
|
</td>
|
559
559
|
<td>
|
560
|
-
<pre class="code"><span class="info file"># File 'lib/rrtf/formatting.rb', line
|
560
|
+
<pre class="code"><span class="info file"># File 'lib/rrtf/formatting.rb', line 663</span>
|
561
561
|
|
562
562
|
<span class='kw'>def</span> <span class='id identifier rubyid_initialize_position_formatting'>initialize_position_formatting</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
563
563
|
<span class='comment'># load default attribute values
|
@@ -644,22 +644,22 @@ be found in the document's colour and font tables, respectively.
|
|
644
644
|
<pre class="lines">
|
645
645
|
|
646
646
|
|
647
|
-
|
648
|
-
|
649
|
-
|
650
|
-
|
651
|
-
|
652
|
-
|
653
|
-
|
654
|
-
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
|
659
|
-
|
647
|
+
695
|
648
|
+
696
|
649
|
+
697
|
650
|
+
698
|
651
|
+
699
|
652
|
+
700
|
653
|
+
701
|
654
|
+
702
|
655
|
+
703
|
656
|
+
704
|
657
|
+
705
|
658
|
+
706
|
659
|
+
707</pre>
|
660
660
|
</td>
|
661
661
|
<td>
|
662
|
-
<pre class="code"><span class="info file"># File 'lib/rrtf/formatting.rb', line
|
662
|
+
<pre class="code"><span class="info file"># File 'lib/rrtf/formatting.rb', line 695</span>
|
663
663
|
|
664
664
|
<span class='kw'>def</span> <span class='id identifier rubyid_position_formatting_to_rtf'>position_formatting_to_rtf</span><span class='lparen'>(</span><span class='id identifier rubyid_document'>document</span><span class='rparen'>)</span>
|
665
665
|
<span class='id identifier rubyid_text'>text</span> <span class='op'>=</span> <span class='const'>StringIO</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
@@ -728,23 +728,23 @@ be found in the document's colour and font tables, respectively.
|
|
728
728
|
<pre class="lines">
|
729
729
|
|
730
730
|
|
731
|
-
|
732
|
-
|
733
|
-
|
734
|
-
|
735
|
-
|
736
|
-
|
737
|
-
|
738
|
-
|
739
|
-
|
740
|
-
|
741
|
-
|
742
|
-
|
743
|
-
|
744
|
-
|
731
|
+
674
|
732
|
+
675
|
733
|
+
676
|
734
|
+
677
|
735
|
+
678
|
736
|
+
679
|
737
|
+
680
|
738
|
+
681
|
739
|
+
682
|
740
|
+
683
|
741
|
+
684
|
742
|
+
685
|
743
|
+
686
|
744
|
+
687</pre>
|
745
745
|
</td>
|
746
746
|
<td>
|
747
|
-
<pre class="code"><span class="info file"># File 'lib/rrtf/formatting.rb', line
|
747
|
+
<pre class="code"><span class="info file"># File 'lib/rrtf/formatting.rb', line 674</span>
|
748
748
|
|
749
749
|
<span class='kw'>def</span> <span class='id identifier rubyid_set_position_formatting_from_hashmap'>set_position_formatting_from_hashmap</span><span class='lparen'>(</span><span class='id identifier rubyid_hash'>hash</span><span class='rparen'>)</span>
|
750
750
|
<span class='id identifier rubyid_hash'>hash</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_attribute'>attribute</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='op'>|</span>
|
@@ -770,7 +770,7 @@ be found in the document's colour and font tables, respectively.
|
|
770
770
|
</div>
|
771
771
|
|
772
772
|
<div id="footer">
|
773
|
-
Generated on
|
773
|
+
Generated on Wed Aug 2 23:05:15 2017 by
|
774
774
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
775
775
|
0.9.9 (ruby-2.3.3).
|
776
776
|
</div>
|
@@ -414,7 +414,7 @@ style object. Equivalent to
414
414
|
</div>
|
|
415
415
|
|
|
416
416
|
<div id="footer">
|
|
417
|
-
Generated on
|
|
417
|
+
Generated on Wed Aug 2 23:05:18 2017 by
|
|
418
418
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
419
419
|
0.9.9 (ruby-2.3.3).
|
|
420
420
|
</div>
|
@@ -233,7 +233,7 @@ classes.
|
|
233
233
|
</div>
|
234
234
|
|
235
235
|
<div id="footer">
|
236
|
-
Generated on
|
236
|
+
Generated on Wed Aug 2 23:05:18 2017 by
|
237
237
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
238
238
|
0.9.9 (ruby-2.3.3).
|
239
239
|
</div>
|
@@ -296,7 +296,7 @@
|
|
296
296
|
</div>
|
297
297
|
|
298
298
|
<div id="footer">
|
299
|
-
Generated on
|
299
|
+
Generated on Wed Aug 2 23:05:16 2017 by
|
300
300
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
301
301
|
0.9.9 (ruby-2.3.3).
|
302
302
|
</div>
|
@@ -0,0 +1,750 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
+
<title>
|
7
|
+
Module: RRTF::SectionFormatting
|
8
|
+
|
9
|
+
— Documentation by YARD 0.9.9
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
pathId = "RRTF::SectionFormatting";
|
19
|
+
relpath = '../';
|
20
|
+
</script>
|
21
|
+
|
22
|
+
|
23
|
+
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
24
|
+
|
25
|
+
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
26
|
+
|
27
|
+
|
28
|
+
</head>
|
29
|
+
<body>
|
30
|
+
<div class="nav_wrap">
|
31
|
+
<iframe id="nav" src="../class_list.html?1"></iframe>
|
32
|
+
<div id="resizer"></div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="main" tabindex="-1">
|
36
|
+
<div id="header">
|
37
|
+
<div id="menu">
|
38
|
+
|
39
|
+
<a href="../_index.html">Index (S)</a> »
|
40
|
+
<span class='title'><span class='object_link'><a href="../RRTF.html" title="RRTF (module)">RRTF</a></span></span>
|
41
|
+
»
|
42
|
+
<span class="title">SectionFormatting</span>
|
43
|
+
|
44
|
+
</div>
|
45
|
+
|
46
|
+
<div id="search">
|
47
|
+
|
48
|
+
<a class="full_list_link" id="class_list_link"
|
49
|
+
href="../class_list.html">
|
50
|
+
|
51
|
+
<svg width="24" height="24">
|
52
|
+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
53
|
+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
54
|
+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
55
|
+
</svg>
|
56
|
+
</a>
|
57
|
+
|
58
|
+
</div>
|
59
|
+
<div class="clear"></div>
|
60
|
+
</div>
|
61
|
+
|
62
|
+
<div id="content"><h1>Module: RRTF::SectionFormatting
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
</h1>
|
67
|
+
<div class="box_info">
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
<dl>
|
78
|
+
<dt>Included in:</dt>
|
79
|
+
<dd><span class='object_link'><a href="SectionStyle.html" title="RRTF::SectionStyle (class)">SectionStyle</a></span></dd>
|
80
|
+
</dl>
|
81
|
+
|
82
|
+
|
83
|
+
|
84
|
+
<dl>
|
85
|
+
<dt>Defined in:</dt>
|
86
|
+
<dd>lib/rrtf/formatting.rb</dd>
|
87
|
+
</dl>
|
88
|
+
|
89
|
+
</div>
|
90
|
+
|
91
|
+
<h2>Overview</h2><div class="docstring">
|
92
|
+
<div class="discussion">
|
93
|
+
|
94
|
+
<p>Section formatting attributes and methods.</p>
|
95
|
+
|
96
|
+
|
97
|
+
</div>
|
98
|
+
</div>
|
99
|
+
<div class="tags">
|
100
|
+
|
101
|
+
<p class="tag_title">Author:</p>
|
102
|
+
<ul class="author">
|
103
|
+
|
104
|
+
<li>
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
<div class='inline'>
|
111
|
+
<p>Wesley Hileman</p>
|
112
|
+
</div>
|
113
|
+
|
114
|
+
</li>
|
115
|
+
|
116
|
+
</ul>
|
117
|
+
<p class="tag_title">Since:</p>
|
118
|
+
<ul class="since">
|
119
|
+
|
120
|
+
<li>
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
|
126
|
+
<div class='inline'>
|
127
|
+
<p>1.0.0</p>
|
128
|
+
</div>
|
129
|
+
|
130
|
+
</li>
|
131
|
+
|
132
|
+
</ul>
|
133
|
+
|
134
|
+
</div>
|
135
|
+
<h2>Constant Summary</h2>
|
136
|
+
<dl class="constants">
|
137
|
+
|
138
|
+
<dt id="SECTION_ATTRIBUTES-constant" class="">SECTION_ATTRIBUTES =
|
139
|
+
<div class="docstring">
|
140
|
+
<div class="discussion">
|
141
|
+
|
142
|
+
<p>Formatting attributes that can be applied to an RTF document section.</p>
|
143
|
+
|
144
|
+
|
145
|
+
</div>
|
146
|
+
</div>
|
147
|
+
<div class="tags">
|
148
|
+
|
149
|
+
<p class="tag_title">Returns:</p>
|
150
|
+
<ul class="return">
|
151
|
+
|
152
|
+
<li>
|
153
|
+
|
154
|
+
|
155
|
+
<span class='type'>(<tt>Hash<String, Hash></tt>)</span>
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
—
|
160
|
+
<div class='inline'>
|
161
|
+
<p>a hash mapping each attribute to a hash that describes (1) the
|
162
|
+
attribute's default value, (2) how to parse the attribute from the
|
163
|
+
user, and (3) how to convert the attribute to an RTF sequence.</p>
|
164
|
+
</div>
|
165
|
+
|
166
|
+
</li>
|
167
|
+
|
168
|
+
</ul>
|
169
|
+
<p class="tag_title">Since:</p>
|
170
|
+
<ul class="since">
|
171
|
+
|
172
|
+
<li>
|
173
|
+
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
|
178
|
+
<div class='inline'>
|
179
|
+
<p>1.0.0</p>
|
180
|
+
</div>
|
181
|
+
|
182
|
+
</li>
|
183
|
+
|
184
|
+
</ul>
|
185
|
+
|
186
|
+
</div>
|
187
|
+
</dt>
|
188
|
+
<dd><pre class="code"><span class='lbrace'>{</span>
|
189
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>columns</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='lbrace'>{</span>
|
190
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>default</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='kw'>nil</span><span class='comma'>,</span>
|
191
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>to_rtf</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='id identifier rubyid_lambda'>lambda</span><span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_value'>value</span><span class='op'>|</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\\cols</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_value'>value</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='rbrace'>}</span>
|
192
|
+
<span class='rbrace'>}</span><span class='comma'>,</span>
|
193
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>column_spacing</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='lbrace'>{</span>
|
194
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>default</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='kw'>nil</span><span class='comma'>,</span>
|
195
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>from_user</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='id identifier rubyid_lambda'>lambda</span><span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_value'>value</span><span class='op'>|</span> <span class='const'><span class='object_link'><a href="../RRTF.html" title="RRTF (module)">RRTF</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Utilities.html" title="RRTF::Utilities (class)">Utilities</a></span></span><span class='period'>.</span><span class='id identifier rubyid_value2twips'><span class='object_link'><a href="Utilities.html#value2twips-class_method" title="RRTF::Utilities.value2twips (method)">value2twips</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span> <span class='rbrace'>}</span><span class='comma'>,</span>
|
196
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>to_rtf</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='id identifier rubyid_lambda'>lambda</span><span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_value'>value</span><span class='op'>|</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\\colsx</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_value'>value</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='rbrace'>}</span>
|
197
|
+
<span class='rbrace'>}</span><span class='comma'>,</span>
|
198
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>mirror_margins</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='lbrace'>{</span>
|
199
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>default</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='kw'>nil</span><span class='comma'>,</span>
|
200
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>to_rtf</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='id identifier rubyid_lambda'>lambda</span><span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_value'>value</span><span class='op'>|</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\\margmirrorsxn</span><span class='tstring_end'>"</span></span> <span class='kw'>if</span> <span class='id identifier rubyid_value'>value</span> <span class='rbrace'>}</span>
|
201
|
+
<span class='rbrace'>}</span>
|
202
|
+
<span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span></pre></dd>
|
203
|
+
|
204
|
+
</dl>
|
205
|
+
|
206
|
+
|
207
|
+
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
|
212
|
+
|
213
|
+
<h2>
|
214
|
+
Class Method Summary
|
215
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
216
|
+
</h2>
|
217
|
+
|
218
|
+
<ul class="summary">
|
219
|
+
|
220
|
+
<li class="public ">
|
221
|
+
<span class="summary_signature">
|
222
|
+
|
223
|
+
<a href="#included-class_method" title="included (class method)">.<strong>included</strong>(base) ⇒ Object </a>
|
224
|
+
|
225
|
+
|
226
|
+
|
227
|
+
</span>
|
228
|
+
|
229
|
+
|
230
|
+
|
231
|
+
|
232
|
+
|
233
|
+
|
234
|
+
|
235
|
+
|
236
|
+
|
237
|
+
<span class="summary_desc"><div class='inline'>
|
238
|
+
<p>Generates attribute accessors for all section attributes when the module is
|
239
|
+
included in another module or class.</p>
|
240
|
+
</div></span>
|
241
|
+
|
242
|
+
</li>
|
243
|
+
|
244
|
+
|
245
|
+
</ul>
|
246
|
+
|
247
|
+
<h2>
|
248
|
+
Instance Method Summary
|
249
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
250
|
+
</h2>
|
251
|
+
|
252
|
+
<ul class="summary">
|
253
|
+
|
254
|
+
<li class="public ">
|
255
|
+
<span class="summary_signature">
|
256
|
+
|
257
|
+
<a href="#initialize_section_formatting-instance_method" title="#initialize_section_formatting (instance method)">#<strong>initialize_section_formatting</strong>(options = {}) ⇒ Object </a>
|
258
|
+
|
259
|
+
|
260
|
+
|
261
|
+
</span>
|
262
|
+
|
263
|
+
|
264
|
+
|
265
|
+
|
266
|
+
|
267
|
+
|
268
|
+
|
269
|
+
|
270
|
+
|
271
|
+
<span class="summary_desc"><div class='inline'>
|
272
|
+
<p>Initializes section formatting attributes.</p>
|
273
|
+
</div></span>
|
274
|
+
|
275
|
+
</li>
|
276
|
+
|
277
|
+
|
278
|
+
<li class="public ">
|
279
|
+
<span class="summary_signature">
|
280
|
+
|
281
|
+
<a href="#section_formatting_to_rtf-instance_method" title="#section_formatting_to_rtf (instance method)">#<strong>section_formatting_to_rtf</strong> ⇒ String </a>
|
282
|
+
|
283
|
+
|
284
|
+
|
285
|
+
</span>
|
286
|
+
|
287
|
+
|
288
|
+
|
289
|
+
|
290
|
+
|
291
|
+
|
292
|
+
|
293
|
+
|
294
|
+
|
295
|
+
<span class="summary_desc"><div class='inline'>
|
296
|
+
<p>Generates an RTF string representing all applied section formatting.</p>
|
297
|
+
</div></span>
|
298
|
+
|
299
|
+
</li>
|
300
|
+
|
301
|
+
|
302
|
+
<li class="public ">
|
303
|
+
<span class="summary_signature">
|
304
|
+
|
305
|
+
<a href="#set_section_formatting_from_hashmap-instance_method" title="#set_section_formatting_from_hashmap (instance method)">#<strong>set_section_formatting_from_hashmap</strong>(hash) ⇒ Object </a>
|
306
|
+
|
307
|
+
|
308
|
+
|
309
|
+
</span>
|
310
|
+
|
311
|
+
|
312
|
+
|
313
|
+
|
314
|
+
|
315
|
+
|
316
|
+
|
317
|
+
|
318
|
+
|
319
|
+
<span class="summary_desc"><div class='inline'>
|
320
|
+
<p>Sets section formatting attributes according to the supplied hashmap.</p>
|
321
|
+
</div></span>
|
322
|
+
|
323
|
+
</li>
|
324
|
+
|
325
|
+
|
326
|
+
</ul>
|
327
|
+
|
328
|
+
|
329
|
+
|
330
|
+
|
331
|
+
<div id="class_method_details" class="method_details_list">
|
332
|
+
<h2>Class Method Details</h2>
|
333
|
+
|
334
|
+
|
335
|
+
<div class="method_details first">
|
336
|
+
<h3 class="signature first" id="included-class_method">
|
337
|
+
|
338
|
+
.<strong>included</strong>(base) ⇒ <tt>Object</tt>
|
339
|
+
|
340
|
+
|
341
|
+
|
342
|
+
|
343
|
+
|
344
|
+
</h3><div class="docstring">
|
345
|
+
<div class="discussion">
|
346
|
+
|
347
|
+
<p>Generates attribute accessors for all section attributes when the module is
|
348
|
+
included in another module or class.</p>
|
349
|
+
|
350
|
+
|
351
|
+
</div>
|
352
|
+
</div>
|
353
|
+
<div class="tags">
|
354
|
+
|
355
|
+
<p class="tag_title">Since:</p>
|
356
|
+
<ul class="since">
|
357
|
+
|
358
|
+
<li>
|
359
|
+
|
360
|
+
|
361
|
+
|
362
|
+
|
363
|
+
|
364
|
+
<div class='inline'>
|
365
|
+
<p>1.0.0</p>
|
366
|
+
</div>
|
367
|
+
|
368
|
+
</li>
|
369
|
+
|
370
|
+
</ul>
|
371
|
+
|
372
|
+
</div><table class="source_code">
|
373
|
+
<tr>
|
374
|
+
<td>
|
375
|
+
<pre class="lines">
|
376
|
+
|
377
|
+
|
378
|
+
928
|
379
|
+
929
|
380
|
+
930
|
381
|
+
931
|
382
|
+
932
|
383
|
+
933
|
384
|
+
934
|
385
|
+
935</pre>
|
386
|
+
</td>
|
387
|
+
<td>
|
388
|
+
<pre class="code"><span class="info file"># File 'lib/rrtf/formatting.rb', line 928</span>
|
389
|
+
|
390
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_included'>included</span><span class='lparen'>(</span><span class='id identifier rubyid_base'>base</span><span class='rparen'>)</span>
|
391
|
+
<span class='comment'># define accessors in base for document attributes
|
392
|
+
</span> <span class='id identifier rubyid_base'>base</span><span class='period'>.</span><span class='id identifier rubyid_class_eval'>class_eval</span> <span class='kw'>do</span>
|
393
|
+
<span class='const'><span class='object_link'><a href="#SECTION_ATTRIBUTES-constant" title="RRTF::SectionFormatting::SECTION_ATTRIBUTES (constant)">SECTION_ATTRIBUTES</a></span></span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='op'>|</span>
|
394
|
+
<span class='id identifier rubyid_attr_accessor'>attr_accessor</span> <span class='symbol'>:#{</span><span class='id identifier rubyid_key'>key</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
395
|
+
<span class='kw'>end</span> <span class='comment'># each
|
396
|
+
</span> <span class='kw'>end</span> <span class='comment'># class_eval
|
397
|
+
</span><span class='kw'>end</span></pre>
|
398
|
+
</td>
|
399
|
+
</tr>
|
400
|
+
</table>
|
401
|
+
</div>
|
402
|
+
|
403
|
+
</div>
|
404
|
+
|
405
|
+
<div id="instance_method_details" class="method_details_list">
|
406
|
+
<h2>Instance Method Details</h2>
|
407
|
+
|
408
|
+
|
409
|
+
<div class="method_details first">
|
410
|
+
<h3 class="signature first" id="initialize_section_formatting-instance_method">
|
411
|
+
|
412
|
+
#<strong>initialize_section_formatting</strong>(options = {}) ⇒ <tt>Object</tt>
|
413
|
+
|
414
|
+
|
415
|
+
|
416
|
+
|
417
|
+
|
418
|
+
</h3><div class="docstring">
|
419
|
+
<div class="discussion">
|
420
|
+
|
421
|
+
<p>Initializes section formatting attributes.</p>
|
422
|
+
|
423
|
+
|
424
|
+
</div>
|
425
|
+
</div>
|
426
|
+
<div class="tags">
|
427
|
+
<p class="tag_title">Parameters:</p>
|
428
|
+
<ul class="param">
|
429
|
+
|
430
|
+
<li>
|
431
|
+
|
432
|
+
<span class='name'>options</span>
|
433
|
+
|
434
|
+
|
435
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
436
|
+
|
437
|
+
|
438
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
439
|
+
|
440
|
+
|
441
|
+
—
|
442
|
+
<div class='inline'>
|
443
|
+
<p>the section formatting options.</p>
|
444
|
+
</div>
|
445
|
+
|
446
|
+
</li>
|
447
|
+
|
448
|
+
</ul>
|
449
|
+
|
450
|
+
|
451
|
+
|
452
|
+
|
453
|
+
<p class="tag_title">Options Hash (<tt>options</tt>):</p>
|
454
|
+
<ul class="option">
|
455
|
+
|
456
|
+
<li>
|
457
|
+
<span class="name">"columns"</span>
|
458
|
+
<span class="type">(<tt>Integer</tt>)</span>
|
459
|
+
<span class="default">
|
460
|
+
|
461
|
+
— default:
|
462
|
+
<tt>nil</tt>
|
463
|
+
|
464
|
+
</span>
|
465
|
+
|
466
|
+
— <div class='inline'>
|
467
|
+
<p>the number of columns in the section.</p>
|
468
|
+
</div>
|
469
|
+
|
470
|
+
</li>
|
471
|
+
|
472
|
+
<li>
|
473
|
+
<span class="name">"column_spacing"</span>
|
474
|
+
<span class="type">(<tt>String</tt>, <tt>Integer</tt>)</span>
|
475
|
+
<span class="default">
|
476
|
+
|
477
|
+
— default:
|
478
|
+
<tt>nil</tt>
|
479
|
+
|
480
|
+
</span>
|
481
|
+
|
482
|
+
— <div class='inline'>
|
483
|
+
<p>the column spacing in twips (can also be a string, see
|
484
|
+
<span class='object_link'><a href="Utilities.html#value2twips-class_method" title="RRTF::Utilities.value2twips (method)">Utilities.value2twips</a></span>).</p>
|
485
|
+
</div>
|
486
|
+
|
487
|
+
</li>
|
488
|
+
|
489
|
+
<li>
|
490
|
+
<span class="name">"mirror_margins"</span>
|
491
|
+
<span class="type">(<tt>Boolean</tt>)</span>
|
492
|
+
<span class="default">
|
493
|
+
|
494
|
+
— default:
|
495
|
+
<tt>nil</tt>
|
496
|
+
|
497
|
+
</span>
|
498
|
+
|
499
|
+
— <div class='inline'>
|
500
|
+
<p>whether or not to enable mirrored margins (when facing pages is enabled) in
|
501
|
+
the document.</p>
|
502
|
+
</div>
|
503
|
+
|
504
|
+
</li>
|
505
|
+
|
506
|
+
</ul>
|
507
|
+
|
508
|
+
|
509
|
+
<p class="tag_title">Since:</p>
|
510
|
+
<ul class="since">
|
511
|
+
|
512
|
+
<li>
|
513
|
+
|
514
|
+
|
515
|
+
|
516
|
+
|
517
|
+
|
518
|
+
<div class='inline'>
|
519
|
+
<p>1.0.0</p>
|
520
|
+
</div>
|
521
|
+
|
522
|
+
</li>
|
523
|
+
|
524
|
+
</ul>
|
525
|
+
|
526
|
+
</div><table class="source_code">
|
527
|
+
<tr>
|
528
|
+
<td>
|
529
|
+
<pre class="lines">
|
530
|
+
|
531
|
+
|
532
|
+
943
|
533
|
+
944
|
534
|
+
945
|
535
|
+
946
|
536
|
+
947
|
537
|
+
948
|
538
|
+
949
|
539
|
+
950</pre>
|
540
|
+
</td>
|
541
|
+
<td>
|
542
|
+
<pre class="code"><span class="info file"># File 'lib/rrtf/formatting.rb', line 943</span>
|
543
|
+
|
544
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize_section_formatting'>initialize_section_formatting</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
545
|
+
<span class='comment'># load default attribute values
|
546
|
+
</span> <span class='const'><span class='object_link'><a href="#SECTION_ATTRIBUTES-constant" title="RRTF::SectionFormatting::SECTION_ATTRIBUTES (constant)">SECTION_ATTRIBUTES</a></span></span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='op'>|</span>
|
547
|
+
<span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_key'>key</span><span class='embexpr_end'>}</span><span class='tstring_content'>=</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>default</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
548
|
+
<span class='kw'>end</span> <span class='comment'># each
|
549
|
+
</span> <span class='comment'># overwrite default attribute values with given values
|
550
|
+
</span> <span class='id identifier rubyid_set_section_formatting_from_hashmap'>set_section_formatting_from_hashmap</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
551
|
+
<span class='kw'>end</span></pre>
|
552
|
+
</td>
|
553
|
+
</tr>
|
554
|
+
</table>
|
555
|
+
</div>
|
556
|
+
|
557
|
+
<div class="method_details ">
|
558
|
+
<h3 class="signature " id="section_formatting_to_rtf-instance_method">
|
559
|
+
|
560
|
+
#<strong>section_formatting_to_rtf</strong> ⇒ <tt>String</tt>
|
561
|
+
|
562
|
+
|
563
|
+
|
564
|
+
|
565
|
+
|
566
|
+
</h3><div class="docstring">
|
567
|
+
<div class="discussion">
|
568
|
+
|
569
|
+
<p>Generates an RTF string representing all applied section formatting.</p>
|
570
|
+
|
571
|
+
|
572
|
+
</div>
|
573
|
+
</div>
|
574
|
+
<div class="tags">
|
575
|
+
|
576
|
+
<p class="tag_title">Returns:</p>
|
577
|
+
<ul class="return">
|
578
|
+
|
579
|
+
<li>
|
580
|
+
|
581
|
+
|
582
|
+
<span class='type'>(<tt>String</tt>)</span>
|
583
|
+
|
584
|
+
|
585
|
+
|
586
|
+
—
|
587
|
+
<div class='inline'>
|
588
|
+
<p>RTF string.</p>
|
589
|
+
</div>
|
590
|
+
|
591
|
+
</li>
|
592
|
+
|
593
|
+
</ul>
|
594
|
+
<p class="tag_title">Since:</p>
|
595
|
+
<ul class="since">
|
596
|
+
|
597
|
+
<li>
|
598
|
+
|
599
|
+
|
600
|
+
|
601
|
+
|
602
|
+
|
603
|
+
<div class='inline'>
|
604
|
+
<p>1.0.0</p>
|
605
|
+
</div>
|
606
|
+
|
607
|
+
</li>
|
608
|
+
|
609
|
+
</ul>
|
610
|
+
|
611
|
+
</div><table class="source_code">
|
612
|
+
<tr>
|
613
|
+
<td>
|
614
|
+
<pre class="lines">
|
615
|
+
|
616
|
+
|
617
|
+
972
|
618
|
+
973
|
619
|
+
974
|
620
|
+
975
|
621
|
+
976
|
622
|
+
977
|
623
|
+
978
|
624
|
+
979
|
625
|
+
980
|
626
|
+
981
|
627
|
+
982
|
628
|
+
983
|
629
|
+
984</pre>
|
630
|
+
</td>
|
631
|
+
<td>
|
632
|
+
<pre class="code"><span class="info file"># File 'lib/rrtf/formatting.rb', line 972</span>
|
633
|
+
|
634
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_section_formatting_to_rtf'>section_formatting_to_rtf</span>
|
635
|
+
<span class='id identifier rubyid_text'>text</span> <span class='op'>=</span> <span class='const'>StringIO</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
636
|
+
|
637
|
+
<span class='comment'># accumulate RTF representations of section attributes
|
638
|
+
</span> <span class='const'><span class='object_link'><a href="#SECTION_ATTRIBUTES-constant" title="RRTF::SectionFormatting::SECTION_ATTRIBUTES (constant)">SECTION_ATTRIBUTES</a></span></span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='op'>|</span>
|
639
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_has_key?'>has_key?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>to_rtf</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
640
|
+
<span class='id identifier rubyid_rtf'>rtf</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>to_rtf</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
641
|
+
<span class='id identifier rubyid_text'>text</span> <span class='op'><<</span> <span class='id identifier rubyid_rtf'>rtf</span> <span class='kw'>unless</span> <span class='id identifier rubyid_rtf'>rtf</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
642
|
+
<span class='kw'>end</span> <span class='comment'># if
|
643
|
+
</span> <span class='kw'>end</span> <span class='comment'># each
|
644
|
+
</span>
|
645
|
+
<span class='id identifier rubyid_text'>text</span><span class='period'>.</span><span class='id identifier rubyid_string'>string</span>
|
646
|
+
<span class='kw'>end</span></pre>
|
647
|
+
</td>
|
648
|
+
</tr>
|
649
|
+
</table>
|
650
|
+
</div>
|
651
|
+
|
652
|
+
<div class="method_details ">
|
653
|
+
<h3 class="signature " id="set_section_formatting_from_hashmap-instance_method">
|
654
|
+
|
655
|
+
#<strong>set_section_formatting_from_hashmap</strong>(hash) ⇒ <tt>Object</tt>
|
656
|
+
|
657
|
+
|
658
|
+
|
659
|
+
|
660
|
+
|
661
|
+
</h3><div class="docstring">
|
662
|
+
<div class="discussion">
|
663
|
+
|
664
|
+
<p>Sets section formatting attributes according to the supplied hashmap.</p>
|
665
|
+
|
666
|
+
|
667
|
+
</div>
|
668
|
+
</div>
|
669
|
+
<div class="tags">
|
670
|
+
|
671
|
+
|
672
|
+
<p class="tag_title">See Also:</p>
|
673
|
+
<ul class="see">
|
674
|
+
|
675
|
+
<li><span class='object_link'><a href="#initialize_section_formatting-instance_method" title="RRTF::SectionFormatting#initialize_section_formatting (method)">#initialize_section_formatting</a></span></li>
|
676
|
+
|
677
|
+
</ul>
|
678
|
+
<p class="tag_title">Since:</p>
|
679
|
+
<ul class="since">
|
680
|
+
|
681
|
+
<li>
|
682
|
+
|
683
|
+
|
684
|
+
|
685
|
+
|
686
|
+
|
687
|
+
<div class='inline'>
|
688
|
+
<p>1.0.0</p>
|
689
|
+
</div>
|
690
|
+
|
691
|
+
</li>
|
692
|
+
|
693
|
+
</ul>
|
694
|
+
|
695
|
+
</div><table class="source_code">
|
696
|
+
<tr>
|
697
|
+
<td>
|
698
|
+
<pre class="lines">
|
699
|
+
|
700
|
+
|
701
|
+
954
|
702
|
+
955
|
703
|
+
956
|
704
|
+
957
|
705
|
+
958
|
706
|
+
959
|
707
|
+
960
|
708
|
+
961
|
709
|
+
962
|
710
|
+
963
|
711
|
+
964
|
712
|
+
965
|
713
|
+
966
|
714
|
+
967</pre>
|
715
|
+
</td>
|
716
|
+
<td>
|
717
|
+
<pre class="code"><span class="info file"># File 'lib/rrtf/formatting.rb', line 954</span>
|
718
|
+
|
719
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_set_section_formatting_from_hashmap'>set_section_formatting_from_hashmap</span><span class='lparen'>(</span><span class='id identifier rubyid_hash'>hash</span><span class='rparen'>)</span>
|
720
|
+
<span class='id identifier rubyid_hash'>hash</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_attribute'>attribute</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='op'>|</span>
|
721
|
+
<span class='comment'># skip unreconized attributes
|
722
|
+
</span> <span class='kw'>next</span> <span class='kw'>unless</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="#SECTION_ATTRIBUTES-constant" title="RRTF::SectionFormatting::SECTION_ATTRIBUTES (constant)">SECTION_ATTRIBUTES</a></span></span><span class='period'>.</span><span class='id identifier rubyid_keys'>keys</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='id identifier rubyid_attribute'>attribute</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
723
|
+
<span class='comment'># preprocess value if nessesary
|
724
|
+
</span> <span class='kw'>if</span> <span class='const'><span class='object_link'><a href="#SECTION_ATTRIBUTES-constant" title="RRTF::SectionFormatting::SECTION_ATTRIBUTES (constant)">SECTION_ATTRIBUTES</a></span></span><span class='lbracket'>[</span><span class='id identifier rubyid_attribute'>attribute</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_has_key?'>has_key?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>from_user</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
725
|
+
<span class='id identifier rubyid_value'>value</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="#SECTION_ATTRIBUTES-constant" title="RRTF::SectionFormatting::SECTION_ATTRIBUTES (constant)">SECTION_ATTRIBUTES</a></span></span><span class='lbracket'>[</span><span class='id identifier rubyid_attribute'>attribute</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>from_user</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
|
726
|
+
<span class='kw'>elsif</span> <span class='const'><span class='object_link'><a href="#SECTION_ATTRIBUTES-constant" title="RRTF::SectionFormatting::SECTION_ATTRIBUTES (constant)">SECTION_ATTRIBUTES</a></span></span><span class='lbracket'>[</span><span class='id identifier rubyid_attribute'>attribute</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_has_key?'>has_key?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>dictionary</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='op'>&&</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>String</span><span class='rparen'>)</span>
|
727
|
+
<span class='id identifier rubyid_value'>value</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="#SECTION_ATTRIBUTES-constant" title="RRTF::SectionFormatting::SECTION_ATTRIBUTES (constant)">SECTION_ATTRIBUTES</a></span></span><span class='lbracket'>[</span><span class='id identifier rubyid_attribute'>attribute</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>dictionary</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='id identifier rubyid_value'>value</span><span class='rbracket'>]</span>
|
728
|
+
<span class='kw'>end</span> <span class='comment'># if
|
729
|
+
</span> <span class='comment'># set attribute value
|
730
|
+
</span> <span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_attribute'>attribute</span><span class='embexpr_end'>}</span><span class='tstring_content'>=</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
|
731
|
+
<span class='kw'>end</span> <span class='comment'># each
|
732
|
+
</span><span class='kw'>end</span></pre>
|
733
|
+
</td>
|
734
|
+
</tr>
|
735
|
+
</table>
|
736
|
+
</div>
|
737
|
+
|
738
|
+
</div>
|
739
|
+
|
740
|
+
</div>
|
741
|
+
|
742
|
+
<div id="footer">
|
743
|
+
Generated on Wed Aug 2 23:05:15 2017 by
|
744
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
745
|
+
0.9.9 (ruby-2.3.3).
|
746
|
+
</div>
|
747
|
+
|
748
|
+
</div>
|
749
|
+
</body>
|
750
|
+
</html>
|