doc/api/classes/Rumai/Area.src/M000095.html in rumai-1.0.0 vs doc/api/classes/Rumai/Area.src/M000095.html in rumai-2.0.0
- old
+ new
@@ -3,16 +3,29 @@
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
- <title>concat (Rumai::Area)</title>
+ <title>length= (Rumai::Area)</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<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/rumai/wm.rb, line 468</span>
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">concat</span> <span class="ruby-identifier">aArea</span>
- <span class="ruby-identifier">push</span> <span class="ruby-identifier">aArea</span>.<span class="ruby-identifier">clients</span>
+ <pre><span class="ruby-comment cmt"># File lib/rumai/wm.rb, line 470</span>
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">length=</span> <span class="ruby-identifier">aMaxClients</span>
+ <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">aMaxClients</span> <span class="ruby-operator">></span> <span class="ruby-value">0</span>
+ <span class="ruby-identifier">len</span>, <span class="ruby-identifier">out</span> = <span class="ruby-identifier">length</span>, <span class="ruby-identifier">fringe</span>
+
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">len</span> <span class="ruby-operator">></span> <span class="ruby-identifier">aMaxClients</span>
+ <span class="ruby-identifier">out</span>.<span class="ruby-identifier">unshift</span> <span class="ruby-identifier">clients</span>[<span class="ruby-identifier">aMaxClients</span><span class="ruby-operator">..</span><span class="ruby-value">-1</span>].<span class="ruby-identifier">reverse</span>
+
+ <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">len</span> <span class="ruby-operator"><</span> <span class="ruby-identifier">aMaxClients</span>
+ <span class="ruby-keyword kw">until</span> (<span class="ruby-identifier">diff</span> = <span class="ruby-identifier">aMaxClients</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">length</span>) <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
+ <span class="ruby-identifier">immigrants</span> = <span class="ruby-identifier">out</span>.<span class="ruby-identifier">clients</span>.<span class="ruby-identifier">first</span>(<span class="ruby-identifier">diff</span>)
+ <span class="ruby-keyword kw">break</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">immigrants</span>.<span class="ruby-identifier">empty?</span>
+
+ <span class="ruby-identifier">push</span> <span class="ruby-identifier">immigrants</span>
+ <span class="ruby-keyword kw">end</span>
+ <span class="ruby-keyword kw">end</span>
<span class="ruby-keyword kw">end</span></pre>
</body>
</html>
\ No newline at end of file