ref/ruby/classes/XX/Document.src/M000079.html in ruby-vpi-8.2.0 vs ref/ruby/classes/XX/Document.src/M000079.html in ruby-vpi-9.0.0

- old
+ new

@@ -3,96 +3,32 @@ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> - <title>&lt;&lt; (XX::Document)</title> + <title>create (XX::Document)</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" /> </head> <body class="standalone-code"> - <pre> <span class="ruby-comment cmt"># File lib/ruby-vpi/xx.rb, line 115</span> -115: <span class="ruby-keyword kw">def</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">object</span> -116: <span class="ruby-comment cmt">#--{{{</span> -117: <span class="ruby-identifier">t</span>, <span class="ruby-identifier">x</span> = <span class="ruby-identifier">top</span>, <span class="ruby-identifier">object</span> -118: -119: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">x</span> -120: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">t</span> -121: <span class="ruby-keyword kw">when</span> <span class="ruby-operator">::</span><span class="ruby-constant">REXML</span><span class="ruby-operator">::</span><span class="ruby-constant">Document</span> -122: -123: <span class="ruby-keyword kw">begin</span> -124: <span class="ruby-identifier">t</span> <span class="ruby-operator">&lt;&lt;</span> -125: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">x</span> -126: <span class="ruby-keyword kw">when</span> <span class="ruby-operator">::</span><span class="ruby-constant">REXML</span><span class="ruby-operator">::</span><span class="ruby-constant">Document</span> -127: <span class="ruby-identifier">x</span>.<span class="ruby-identifier">root</span> <span class="ruby-operator">||</span> <span class="ruby-operator">::</span><span class="ruby-constant">REXML</span><span class="ruby-operator">::</span><span class="ruby-constant">Text</span><span class="ruby-operator">::</span><span class="ruby-identifier">new</span>(<span class="ruby-identifier">x</span>.<span class="ruby-identifier">to_s</span>) -128: <span class="ruby-keyword kw">when</span> <span class="ruby-operator">::</span><span class="ruby-constant">REXML</span><span class="ruby-operator">::</span><span class="ruby-constant">Element</span> -129: <span class="ruby-identifier">x</span> -130: <span class="ruby-keyword kw">when</span> <span class="ruby-operator">::</span><span class="ruby-constant">REXML</span><span class="ruby-operator">::</span><span class="ruby-constant">CData</span> -131: <span class="ruby-identifier">x</span> -132: <span class="ruby-keyword kw">when</span> <span class="ruby-operator">::</span><span class="ruby-constant">REXML</span><span class="ruby-operator">::</span><span class="ruby-constant">Text</span> -133: <span class="ruby-identifier">x</span> -134: <span class="ruby-keyword kw">else</span> <span class="ruby-comment cmt"># string</span> -135: <span class="ruby-operator">::</span><span class="ruby-constant">REXML</span><span class="ruby-operator">::</span><span class="ruby-constant">Text</span><span class="ruby-operator">::</span><span class="ruby-identifier">new</span>(<span class="ruby-identifier">x</span>.<span class="ruby-identifier">to_s</span>) -136: <span class="ruby-keyword kw">end</span> -137: <span class="ruby-keyword kw">rescue</span> -138: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">t</span>.<span class="ruby-identifier">respond_to?</span> <span class="ruby-value str">&quot;root&quot;</span> -139: <span class="ruby-identifier">t</span> = <span class="ruby-identifier">t</span>.<span class="ruby-identifier">root</span> -140: <span class="ruby-keyword kw">retry</span> -141: <span class="ruby-keyword kw">else</span> -142: <span class="ruby-identifier">raise</span> -143: <span class="ruby-keyword kw">end</span> -144: <span class="ruby-keyword kw">end</span> -145: -146: <span class="ruby-keyword kw">when</span> <span class="ruby-operator">::</span><span class="ruby-constant">REXML</span><span class="ruby-operator">::</span><span class="ruby-constant">Element</span> -147: <span class="ruby-identifier">t</span> <span class="ruby-operator">&lt;&lt;</span> -148: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">x</span> -149: <span class="ruby-keyword kw">when</span> <span class="ruby-operator">::</span><span class="ruby-constant">REXML</span><span class="ruby-operator">::</span><span class="ruby-constant">Document</span> -150: <span class="ruby-identifier">x</span>.<span class="ruby-identifier">root</span> <span class="ruby-operator">||</span> <span class="ruby-operator">::</span><span class="ruby-constant">REXML</span><span class="ruby-operator">::</span><span class="ruby-constant">Text</span><span class="ruby-operator">::</span><span class="ruby-identifier">new</span>(<span class="ruby-identifier">x</span>.<span class="ruby-identifier">to_s</span>) -151: <span class="ruby-keyword kw">when</span> <span class="ruby-operator">::</span><span class="ruby-constant">REXML</span><span class="ruby-operator">::</span><span class="ruby-constant">Element</span> -152: <span class="ruby-identifier">x</span> -153: <span class="ruby-keyword kw">when</span> <span class="ruby-operator">::</span><span class="ruby-constant">REXML</span><span class="ruby-operator">::</span><span class="ruby-constant">CData</span> -154: <span class="ruby-comment cmt">#::REXML::Text::new(x.write(&quot;&quot;))</span> -155: <span class="ruby-identifier">x</span> -156: <span class="ruby-keyword kw">when</span> <span class="ruby-operator">::</span><span class="ruby-constant">REXML</span><span class="ruby-operator">::</span><span class="ruby-constant">Text</span> -157: <span class="ruby-identifier">x</span> -158: <span class="ruby-keyword kw">else</span> <span class="ruby-comment cmt"># string</span> -159: <span class="ruby-operator">::</span><span class="ruby-constant">REXML</span><span class="ruby-operator">::</span><span class="ruby-constant">Text</span><span class="ruby-operator">::</span><span class="ruby-identifier">new</span>(<span class="ruby-identifier">x</span>.<span class="ruby-identifier">to_s</span>) -160: <span class="ruby-keyword kw">end</span> -161: -162: <span class="ruby-keyword kw">when</span> <span class="ruby-operator">::</span><span class="ruby-constant">REXML</span><span class="ruby-operator">::</span><span class="ruby-constant">Text</span> -163: <span class="ruby-identifier">t</span> <span class="ruby-operator">&lt;&lt;</span> -164: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">x</span> -165: <span class="ruby-keyword kw">when</span> <span class="ruby-operator">::</span><span class="ruby-constant">REXML</span><span class="ruby-operator">::</span><span class="ruby-constant">Document</span> -166: <span class="ruby-identifier">x</span>.<span class="ruby-identifier">write</span> <span class="ruby-value str">&quot;&quot;</span> -167: <span class="ruby-keyword kw">when</span> <span class="ruby-operator">::</span><span class="ruby-constant">REXML</span><span class="ruby-operator">::</span><span class="ruby-constant">Element</span> -168: <span class="ruby-identifier">x</span>.<span class="ruby-identifier">write</span> <span class="ruby-value str">&quot;&quot;</span> -169: <span class="ruby-keyword kw">when</span> <span class="ruby-operator">::</span><span class="ruby-constant">REXML</span><span class="ruby-operator">::</span><span class="ruby-constant">CData</span> -170: <span class="ruby-identifier">x</span>.<span class="ruby-identifier">write</span> <span class="ruby-value str">&quot;&quot;</span> -171: <span class="ruby-keyword kw">when</span> <span class="ruby-operator">::</span><span class="ruby-constant">REXML</span><span class="ruby-operator">::</span><span class="ruby-constant">Text</span> -172: <span class="ruby-identifier">x</span>.<span class="ruby-identifier">write</span> <span class="ruby-value str">&quot;&quot;</span> -173: <span class="ruby-keyword kw">else</span> <span class="ruby-comment cmt"># string</span> -174: <span class="ruby-identifier">x</span>.<span class="ruby-identifier">to_s</span> -175: <span class="ruby-keyword kw">end</span> -176: -177: <span class="ruby-keyword kw">else</span> <span class="ruby-comment cmt"># other - try anyhow</span> -178: <span class="ruby-identifier">t</span> <span class="ruby-operator">&lt;&lt;</span> -179: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">x</span> -180: <span class="ruby-keyword kw">when</span> <span class="ruby-operator">::</span><span class="ruby-constant">REXML</span><span class="ruby-operator">::</span><span class="ruby-constant">Document</span> -181: <span class="ruby-identifier">x</span>.<span class="ruby-identifier">write</span> <span class="ruby-value str">&quot;&quot;</span> -182: <span class="ruby-keyword kw">when</span> <span class="ruby-operator">::</span><span class="ruby-constant">REXML</span><span class="ruby-operator">::</span><span class="ruby-constant">Element</span> -183: <span class="ruby-identifier">x</span>.<span class="ruby-identifier">write</span> <span class="ruby-value str">&quot;&quot;</span> -184: <span class="ruby-keyword kw">when</span> <span class="ruby-operator">::</span><span class="ruby-constant">REXML</span><span class="ruby-operator">::</span><span class="ruby-constant">CData</span> -185: <span class="ruby-identifier">x</span>.<span class="ruby-identifier">write</span> <span class="ruby-value str">&quot;&quot;</span> -186: <span class="ruby-keyword kw">when</span> <span class="ruby-operator">::</span><span class="ruby-constant">REXML</span><span class="ruby-operator">::</span><span class="ruby-constant">Text</span> -187: <span class="ruby-identifier">x</span>.<span class="ruby-identifier">write</span> <span class="ruby-value str">&quot;&quot;</span> -188: <span class="ruby-keyword kw">else</span> <span class="ruby-comment cmt"># string</span> -189: <span class="ruby-identifier">x</span>.<span class="ruby-identifier">to_s</span> -190: <span class="ruby-keyword kw">end</span> -191: <span class="ruby-keyword kw">end</span> -192: <span class="ruby-keyword kw">end</span> -193: -194: <span class="ruby-ivar">@size</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span> -195: <span class="ruby-keyword kw">self</span> -196: <span class="ruby-comment cmt">#--}}}</span> -197: <span class="ruby-keyword kw">end</span></pre> + <pre> <span class="ruby-comment cmt"># File lib/ruby-vpi/xx.rb, line 96</span> + 96: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">create</span> <span class="ruby-identifier">element</span> + 97: <span class="ruby-comment cmt">#--{{{</span> + 98: <span class="ruby-identifier">push</span> <span class="ruby-identifier">element</span> + 99: <span class="ruby-keyword kw">begin</span> +100: <span class="ruby-identifier">object</span> = <span class="ruby-keyword kw">nil</span> +101: <span class="ruby-identifier">additions</span> = +102: <span class="ruby-identifier">tracking_additions</span> <span class="ruby-keyword kw">do</span> +103: <span class="ruby-identifier">object</span> = <span class="ruby-keyword kw">yield</span> <span class="ruby-identifier">element</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span> +104: <span class="ruby-keyword kw">end</span> +105: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">object</span> <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">additions</span>.<span class="ruby-identifier">zero?</span> +106: <span class="ruby-keyword kw">self</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">object</span> +107: <span class="ruby-keyword kw">end</span> +108: <span class="ruby-keyword kw">ensure</span> +109: <span class="ruby-identifier">pop</span> +110: <span class="ruby-keyword kw">end</span> +111: <span class="ruby-keyword kw">self</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">element</span> +112: <span class="ruby-identifier">element</span> +113: <span class="ruby-comment cmt">#--}}}</span> +114: <span class="ruby-keyword kw">end</span></pre> </body> </html> \ No newline at end of file