2017-05-07 20:59:34 +00:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<meta charset="utf-8">
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
|
|
<title>
|
|
|
|
Class: Planter::Plot
|
|
|
|
|
|
|
|
— Sapling Documentation
|
|
|
|
|
|
|
|
</title>
|
|
|
|
|
|
|
|
<link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
|
|
|
|
|
|
|
|
<link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
|
|
|
|
|
|
|
|
<script type="text/javascript" charset="utf-8">
|
|
|
|
pathId = "Planter::Plot";
|
|
|
|
relpath = '../';
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
|
|
|
|
|
|
|
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
|
|
|
|
|
|
|
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<div class="nav_wrap">
|
|
|
|
<iframe id="nav" src="../class_list.html?1"></iframe>
|
|
|
|
<div id="resizer"></div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div id="main" tabindex="-1">
|
|
|
|
<div id="header">
|
|
|
|
<div id="menu">
|
|
|
|
|
|
|
|
<a href="../_index.html">Index (P)</a> »
|
|
|
|
<span class='title'><span class='object_link'><a href="../Planter.html" title="Planter (module)">Planter</a></span></span>
|
|
|
|
»
|
|
|
|
<span class="title">Plot</span>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div id="search">
|
|
|
|
|
|
|
|
<a class="full_list_link" id="class_list_link"
|
|
|
|
href="../class_list.html">
|
|
|
|
|
|
|
|
<svg width="24" height="24">
|
|
|
|
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
|
|
|
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
|
|
|
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
|
|
|
</svg>
|
|
|
|
</a>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<div class="clear"></div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div id="content"><h1>Class: Planter::Plot
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</h1>
|
|
|
|
<div class="box_info">
|
|
|
|
|
|
|
|
<dl>
|
|
|
|
<dt>Inherits:</dt>
|
|
|
|
<dd>
|
|
|
|
<span class="inheritName">Object</span>
|
|
|
|
|
|
|
|
<ul class="fullTree">
|
|
|
|
<li>Object</li>
|
|
|
|
|
|
|
|
<li class="next">Planter::Plot</li>
|
|
|
|
|
|
|
|
</ul>
|
|
|
|
<a href="#" class="inheritanceTree">show all</a>
|
|
|
|
|
|
|
|
</dd>
|
|
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<dl>
|
|
|
|
<dt>Defined in:</dt>
|
|
|
|
<dd>lib/sapling/planter.rb</dd>
|
|
|
|
</dl>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
2017-10-15 03:40:38 +00:00
|
|
|
<h2>Overview</h2><div class="docstring">
|
|
|
|
<div class="discussion">
|
|
|
|
|
|
|
|
<p>In-memory tree</p>
|
2017-05-07 20:59:34 +00:00
|
|
|
|
|
|
|
|
2017-10-15 03:40:38 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="tags">
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
2017-05-07 20:59:34 +00:00
|
|
|
|
|
|
|
|
|
|
|
<h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
|
|
|
|
<ul class="summary">
|
|
|
|
|
|
|
|
<li class="public ">
|
|
|
|
<span class="summary_signature">
|
|
|
|
|
|
|
|
<a href="#branches-instance_method" title="#branches (instance method)">#<strong>branches</strong> ⇒ Object </a>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="summary_desc"><div class='inline'>
|
|
|
|
<p>The tree, trunk, and branches.</p>
|
|
|
|
</div></span>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
<li class="public ">
|
|
|
|
<span class="summary_signature">
|
|
|
|
|
|
|
|
<a href="#tree-instance_method" title="#tree (instance method)">#<strong>tree</strong> ⇒ Object </a>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="summary_desc"><div class='inline'>
|
|
|
|
<p>The tree, trunk, and branches.</p>
|
|
|
|
</div></span>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
<li class="public ">
|
|
|
|
<span class="summary_signature">
|
|
|
|
|
|
|
|
<a href="#trunk-instance_method" title="#trunk (instance method)">#<strong>trunk</strong> ⇒ Object </a>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="summary_desc"><div class='inline'>
|
|
|
|
<p>The tree, trunk, and branches.</p>
|
|
|
|
</div></span>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-10-15 03:40:38 +00:00
|
|
|
|
|
|
|
<h2>
|
|
|
|
Instance Method Summary
|
|
|
|
<small><a href="#" class="summary_toggle">collapse</a></small>
|
|
|
|
</h2>
|
|
|
|
|
|
|
|
<ul class="summary">
|
|
|
|
|
|
|
|
<li class="public ">
|
|
|
|
<span class="summary_signature">
|
|
|
|
|
|
|
|
<a href="#edit_branch-instance_method" title="#edit_branch (instance method)">#<strong>edit_branch</strong>(branch_no) ⇒ Object </a>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="summary_desc"><div class='inline'>
|
|
|
|
<p>Edit a branch on the tree.</p>
|
|
|
|
</div></span>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
<li class="public ">
|
|
|
|
<span class="summary_signature">
|
|
|
|
|
|
|
|
<a href="#edit_leaf-instance_method" title="#edit_leaf (instance method)">#<strong>edit_leaf</strong>(branch, leaf) ⇒ Object </a>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="summary_desc"><div class='inline'>
|
|
|
|
<p>Edit a leaf on a branch, grasshopper.</p>
|
|
|
|
</div></span>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
<li class="public ">
|
|
|
|
<span class="summary_signature">
|
|
|
|
|
|
|
|
<a href="#edit_trunk-instance_method" title="#edit_trunk (instance method)">#<strong>edit_trunk</strong> ⇒ Object </a>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="summary_desc"><div class='inline'>
|
|
|
|
<p>Edit the trunk of the tree.</p>
|
|
|
|
</div></span>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
|
2017-05-07 20:59:34 +00:00
|
|
|
|
|
|
|
<div id="instance_attr_details" class="attr_details">
|
|
|
|
<h2>Instance Attribute Details</h2>
|
|
|
|
|
|
|
|
|
|
|
|
<span id="branches=-instance_method"></span>
|
|
|
|
<div class="method_details first">
|
|
|
|
<h3 class="signature first" id="branches-instance_method">
|
|
|
|
|
|
|
|
#<strong>branches</strong> ⇒ <tt>Object</tt>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</h3><div class="docstring">
|
|
|
|
<div class="discussion">
|
|
|
|
|
|
|
|
<p>The tree, trunk, and branches</p>
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="tags">
|
|
|
|
|
|
|
|
|
|
|
|
</div><table class="source_code">
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<pre class="lines">
|
|
|
|
|
|
|
|
|
2017-10-15 03:40:38 +00:00
|
|
|
12
|
|
|
|
13
|
|
|
|
14</pre>
|
2017-05-07 20:59:34 +00:00
|
|
|
</td>
|
|
|
|
<td>
|
2017-10-15 03:40:38 +00:00
|
|
|
<pre class="code"><span class="info file"># File 'lib/sapling/planter.rb', line 12</span>
|
2017-05-07 20:59:34 +00:00
|
|
|
|
|
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_branches'>branches</span>
|
|
|
|
<span class='ivar'>@branches</span>
|
|
|
|
<span class='kw'>end</span></pre>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<span id="tree=-instance_method"></span>
|
|
|
|
<div class="method_details ">
|
|
|
|
<h3 class="signature " id="tree-instance_method">
|
|
|
|
|
|
|
|
#<strong>tree</strong> ⇒ <tt>Object</tt>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</h3><div class="docstring">
|
|
|
|
<div class="discussion">
|
|
|
|
|
|
|
|
<p>The tree, trunk, and branches</p>
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="tags">
|
|
|
|
|
|
|
|
|
|
|
|
</div><table class="source_code">
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<pre class="lines">
|
|
|
|
|
|
|
|
|
2017-10-15 03:40:38 +00:00
|
|
|
12
|
|
|
|
13
|
|
|
|
14</pre>
|
2017-05-07 20:59:34 +00:00
|
|
|
</td>
|
|
|
|
<td>
|
2017-10-15 03:40:38 +00:00
|
|
|
<pre class="code"><span class="info file"># File 'lib/sapling/planter.rb', line 12</span>
|
2017-05-07 20:59:34 +00:00
|
|
|
|
|
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_tree'>tree</span>
|
|
|
|
<span class='ivar'>@tree</span>
|
|
|
|
<span class='kw'>end</span></pre>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<span id="trunk=-instance_method"></span>
|
|
|
|
<div class="method_details ">
|
|
|
|
<h3 class="signature " id="trunk-instance_method">
|
|
|
|
|
|
|
|
#<strong>trunk</strong> ⇒ <tt>Object</tt>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</h3><div class="docstring">
|
|
|
|
<div class="discussion">
|
|
|
|
|
|
|
|
<p>The tree, trunk, and branches</p>
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="tags">
|
|
|
|
|
|
|
|
|
|
|
|
</div><table class="source_code">
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<pre class="lines">
|
|
|
|
|
|
|
|
|
2017-10-15 03:40:38 +00:00
|
|
|
12
|
|
|
|
13
|
|
|
|
14</pre>
|
2017-05-07 20:59:34 +00:00
|
|
|
</td>
|
|
|
|
<td>
|
2017-10-15 03:40:38 +00:00
|
|
|
<pre class="code"><span class="info file"># File 'lib/sapling/planter.rb', line 12</span>
|
2017-05-07 20:59:34 +00:00
|
|
|
|
|
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_trunk'>trunk</span>
|
|
|
|
<span class='ivar'>@trunk</span>
|
|
|
|
<span class='kw'>end</span></pre>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
2017-10-15 03:40:38 +00:00
|
|
|
<div id="instance_method_details" class="method_details_list">
|
|
|
|
<h2>Instance Method Details</h2>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="method_details first">
|
|
|
|
<h3 class="signature first" id="edit_branch-instance_method">
|
|
|
|
|
|
|
|
#<strong>edit_branch</strong>(branch_no) ⇒ <tt>Object</tt>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</h3><div class="docstring">
|
|
|
|
<div class="discussion">
|
|
|
|
|
|
|
|
<p>Edit a branch on the tree</p>
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="tags">
|
|
|
|
<p class="tag_title">Parameters:</p>
|
|
|
|
<ul class="param">
|
|
|
|
|
|
|
|
<li>
|
|
|
|
|
|
|
|
<span class='name'>branch</span>
|
|
|
|
|
|
|
|
|
|
|
|
<span class='type'>(<tt>Integer</tt>)</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
—
|
|
|
|
<div class='inline'>
|
|
|
|
<p>The number of the branch to be edited.</p>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</div><table class="source_code">
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<pre class="lines">
|
|
|
|
|
|
|
|
|
|
|
|
32
|
|
|
|
33
|
|
|
|
34
|
|
|
|
35
|
|
|
|
36
|
|
|
|
37
|
|
|
|
38
|
|
|
|
39
|
|
|
|
40
|
|
|
|
41
|
|
|
|
42
|
|
|
|
43
|
|
|
|
44</pre>
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<pre class="code"><span class="info file"># File 'lib/sapling/planter.rb', line 32</span>
|
|
|
|
|
|
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_edit_branch'>edit_branch</span><span class='lparen'>(</span><span class='id identifier rubyid_branch_no'>branch_no</span><span class='rparen'>)</span>
|
|
|
|
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Current Branch:\n</span><span class='tstring_end'>"</span></span>
|
|
|
|
<span class='const'><span class='object_link'><a href="../Dialogue.html" title="Dialogue (module)">Dialogue</a></span></span><span class='period'>.</span><span class='id identifier rubyid_display_branch'><span class='object_link'><a href="../Dialogue.html#display_branch-class_method" title="Dialogue.display_branch (method)">display_branch</a></span></span><span class='lparen'>(</span><span class='ivar'>@branches</span><span class='lbracket'>[</span><span class='id identifier rubyid_branch_no'>branch_no</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_branch_no'>branch_no</span><span class='comma'>,</span> <span class='kw'>true</span><span class='rparen'>)</span>
|
|
|
|
<span class='id identifier rubyid_print'>print</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\n[ =EDITING= ](CTRL-C to abort)> </span><span class='tstring_end'>"</span></span>
|
|
|
|
<span class='const'>STDOUT</span><span class='period'>.</span><span class='id identifier rubyid_flush'>flush</span>
|
|
|
|
<span class='kw'>begin</span>
|
|
|
|
<span class='id identifier rubyid_new_branch'>new_branch</span> <span class='op'>=</span> <span class='const'>STDIN</span><span class='period'>.</span><span class='id identifier rubyid_gets'>gets</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span>
|
|
|
|
<span class='kw'>rescue</span> <span class='const'>Interrupt</span>
|
|
|
|
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\n**Aborting edit**\n\n</span><span class='tstring_end'>"</span></span>
|
|
|
|
<span class='id identifier rubyid_new_branch'>new_branch</span> <span class='op'>=</span> <span class='ivar'>@branches</span><span class='lbracket'>[</span><span class='id identifier rubyid_branch_no'>branch_no</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>desc</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span>
|
|
|
|
<span class='kw'>end</span>
|
|
|
|
<span class='ivar'>@branches</span><span class='lbracket'>[</span><span class='id identifier rubyid_branch_no'>branch_no</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>desc</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_new_branch'>new_branch</span>
|
|
|
|
<span class='kw'>end</span></pre>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="method_details ">
|
|
|
|
<h3 class="signature " id="edit_leaf-instance_method">
|
|
|
|
|
|
|
|
#<strong>edit_leaf</strong>(branch, leaf) ⇒ <tt>Object</tt>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</h3><div class="docstring">
|
|
|
|
<div class="discussion">
|
|
|
|
|
|
|
|
<p>Edit a leaf on a branch, grasshopper</p>
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="tags">
|
|
|
|
<p class="tag_title">Parameters:</p>
|
|
|
|
<ul class="param">
|
|
|
|
|
|
|
|
<li>
|
|
|
|
|
|
|
|
<span class='name'>branch</span>
|
|
|
|
|
|
|
|
|
|
|
|
<span class='type'>(<tt>Integer</tt>)</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
—
|
|
|
|
<div class='inline'>
|
|
|
|
<p>The number of the branch to be edited.</p>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
|
|
|
|
<li>
|
|
|
|
|
|
|
|
<span class='name'>leaf</span>
|
|
|
|
|
|
|
|
|
|
|
|
<span class='type'>(<tt>Hash</tt>)</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
—
|
|
|
|
<div class='inline'>
|
|
|
|
<p>The leaf hash to be edited.</p>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</div><table class="source_code">
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<pre class="lines">
|
|
|
|
|
|
|
|
|
|
|
|
50
|
|
|
|
51
|
|
|
|
52</pre>
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<pre class="code"><span class="info file"># File 'lib/sapling/planter.rb', line 50</span>
|
|
|
|
|
|
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_edit_leaf'>edit_leaf</span><span class='lparen'>(</span><span class='id identifier rubyid_branch'>branch</span><span class='comma'>,</span> <span class='id identifier rubyid_leaf'>leaf</span><span class='rparen'>)</span>
|
|
|
|
|
|
|
|
<span class='kw'>end</span></pre>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="method_details ">
|
|
|
|
<h3 class="signature " id="edit_trunk-instance_method">
|
|
|
|
|
|
|
|
#<strong>edit_trunk</strong> ⇒ <tt>Object</tt>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</h3><div class="docstring">
|
|
|
|
<div class="discussion">
|
|
|
|
|
|
|
|
<p>Edit the trunk of the tree</p>
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="tags">
|
|
|
|
|
|
|
|
|
|
|
|
</div><table class="source_code">
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<pre class="lines">
|
|
|
|
|
|
|
|
|
|
|
|
15
|
|
|
|
16
|
|
|
|
17
|
|
|
|
18
|
|
|
|
19
|
|
|
|
20
|
|
|
|
21
|
|
|
|
22
|
|
|
|
23
|
|
|
|
24
|
|
|
|
25
|
|
|
|
26
|
|
|
|
27</pre>
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<pre class="code"><span class="info file"># File 'lib/sapling/planter.rb', line 15</span>
|
|
|
|
|
|
|
|
<span class='kw'>def</span> <span class='id identifier rubyid_edit_trunk'>edit_trunk</span>
|
|
|
|
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Current Trunk:\n</span><span class='tstring_end'>"</span></span>
|
|
|
|
<span class='const'><span class='object_link'><a href="../Dialogue.html" title="Dialogue (module)">Dialogue</a></span></span><span class='period'>.</span><span class='id identifier rubyid_display_trunk'><span class='object_link'><a href="../Dialogue.html#display_trunk-class_method" title="Dialogue.display_trunk (method)">display_trunk</a></span></span><span class='lparen'>(</span><span class='ivar'>@trunk</span><span class='comma'>,</span> <span class='kw'>true</span><span class='rparen'>)</span>
|
|
|
|
<span class='id identifier rubyid_print'>print</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\n[ =EDITING= ](CTRL-C to abort)> </span><span class='tstring_end'>"</span></span>
|
|
|
|
<span class='const'>STDOUT</span><span class='period'>.</span><span class='id identifier rubyid_flush'>flush</span>
|
|
|
|
<span class='kw'>begin</span>
|
|
|
|
<span class='id identifier rubyid_new_trunk'>new_trunk</span> <span class='op'>=</span> <span class='const'>STDIN</span><span class='period'>.</span><span class='id identifier rubyid_gets'>gets</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span>
|
|
|
|
<span class='kw'>rescue</span> <span class='const'>Interrupt</span>
|
|
|
|
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\n**Aborting edit**\n\n</span><span class='tstring_end'>"</span></span>
|
|
|
|
<span class='id identifier rubyid_new_trunk'>new_trunk</span> <span class='op'>=</span> <span class='ivar'>@trunk</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>trunk</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span>
|
|
|
|
<span class='kw'>end</span>
|
|
|
|
<span class='ivar'>@trunk</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>trunk</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_new_trunk'>new_trunk</span>
|
|
|
|
<span class='kw'>end</span></pre>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
2017-05-07 20:59:34 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div id="footer">
|
2017-10-15 03:40:38 +00:00
|
|
|
Generated on Sat Oct 14 23:40:01 2017 by
|
2017-05-07 20:59:34 +00:00
|
|
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
2017-10-15 03:40:38 +00:00
|
|
|
0.9.9 (ruby-2.4.2).
|
2017-05-07 20:59:34 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</body>
|
|
|
|
</html>
|