docs/CodeMessage.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
Class: CodeMessage
— Documentation by YARD 0.9.19
</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 = "CodeMessage";
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 (C)</a> »
<span class="title">CodeMessage</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: CodeMessage
</h1>
<div class="box_info">
<dl>
<dt>Inherits:</dt>
<dd>
<span class="inheritName">Object</span>
<ul class="fullTree">
<li>Object</li>
<li class="next">CodeMessage</li>
</ul>
<a href="#" class="inheritanceTree">show all</a>
</dd>
</dl>
<dl>
<dt>Includes:</dt>
<dd>Comparable</dd>
</dl>
<dl>
<dt>Defined in:</dt>
<dd>lib/codemessage.rb</dd>
</dl>
</div>
<h2>Overview</h2><div class="docstring">
<div class="discussion">
<p>warnings and errors from code compilation</p>
</div>
</div>
<div class="tags">
</div>
<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="#colnumber-instance_method" title="#colnumber (instance method)">#<strong>colnumber</strong> ⇒ Object </a>
</span>
<span class="note title readonly">readonly</span>
<span class="summary_desc"><div class='inline'>
<p>Returns the value of attribute colnumber.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#filename-instance_method" title="#filename (instance method)">#<strong>filename</strong> ⇒ Object </a>
</span>
<span class="note title readonly">readonly</span>
<span class="summary_desc"><div class='inline'>
<p>Returns the value of attribute filename.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#linenumber-instance_method" title="#linenumber (instance method)">#<strong>linenumber</strong> ⇒ Object </a>
</span>
<span class="note title readonly">readonly</span>
<span class="summary_desc"><div class='inline'>
<p>Returns the value of attribute linenumber.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#message-instance_method" title="#message (instance method)">#<strong>message</strong> ⇒ Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Returns the value of attribute message.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#messagetype-instance_method" title="#messagetype (instance method)">#<strong>messagetype</strong> ⇒ Object </a>
</span>
<span class="note title readonly">readonly</span>
<span class="summary_desc"><div class='inline'>
<p>Returns the value of attribute messagetype.</p>
</div></span>
</li>
</ul>
<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="#<=>-instance_method" title="#<=> (instance method)">#<strong><=></strong>(other) ⇒ Boolean </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Checks if two CodeMessage objects are different.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#eql%3F-instance_method" title="#eql? (instance method)">#<strong>eql?</strong>(other) ⇒ Boolean </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Checks if two CodeMessage objects are equal.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#error%3F-instance_method" title="#error? (instance method)">#<strong>error?</strong> ⇒ Boolean </a>
</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#hash-instance_method" title="#hash (instance method)">#<strong>hash</strong> ⇒ Object </a>
</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(filename, linenumber, colnumber, messagetype, message) ⇒ CodeMessage </a>
</span>
<span class="note title constructor">constructor</span>
<span class="summary_desc"><div class='inline'>
<p>A new instance of CodeMessage.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#inspect-instance_method" title="#inspect (instance method)">#<strong>inspect</strong> ⇒ Object </a>
</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#warning%3F-instance_method" title="#warning? (instance method)">#<strong>warning?</strong> ⇒ Boolean </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Checks if this instance constitutes a warning.</p>
</div></span>
</li>
</ul>
<div id="constructor_details" class="method_details_list">
<h2>Constructor Details</h2>
<div class="method_details first">
<h3 class="signature first" id="initialize-instance_method">
#<strong>initialize</strong>(filename, linenumber, colnumber, messagetype, message) ⇒ <tt><span class='object_link'><a href="" title="CodeMessage (class)">CodeMessage</a></span></tt>
</h3><div class="docstring">
<div class="discussion">
<p>Returns a new instance of CodeMessage</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
9
10
11
12
13
14
15</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/codemessage.rb', line 9</span>
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_filename'>filename</span><span class='comma'>,</span> <span class='id identifier rubyid_linenumber'>linenumber</span><span class='comma'>,</span> <span class='id identifier rubyid_colnumber'>colnumber</span><span class='comma'>,</span> <span class='id identifier rubyid_messagetype'>messagetype</span><span class='comma'>,</span> <span class='id identifier rubyid_message'>message</span><span class='rparen'>)</span>
<span class='ivar'>@filename</span> <span class='op'>=</span> <span class='id identifier rubyid_filename'>filename</span>
<span class='ivar'>@linenumber</span> <span class='op'>=</span> <span class='id identifier rubyid_linenumber'>linenumber</span>
<span class='ivar'>@colnumber</span> <span class='op'>=</span> <span class='id identifier rubyid_colnumber'>colnumber</span>
<span class='ivar'>@messagetype</span> <span class='op'>=</span> <span class='id identifier rubyid_messagetype'>messagetype</span>
<span class='ivar'>@message</span> <span class='op'>=</span> <span class='id identifier rubyid_message'>message</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
</div>
<div id="instance_attr_details" class="attr_details">
<h2>Instance Attribute Details</h2>
<span id=""></span>
<div class="method_details first">
<h3 class="signature first" id="colnumber-instance_method">
#<strong>colnumber</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
</h3><div class="docstring">
<div class="discussion">
<p>Returns the value of attribute colnumber</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
6
7
8</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/codemessage.rb', line 6</span>
<span class='kw'>def</span> <span class='id identifier rubyid_colnumber'>colnumber</span>
<span class='ivar'>@colnumber</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<span id=""></span>
<div class="method_details ">
<h3 class="signature " id="filename-instance_method">
#<strong>filename</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
</h3><div class="docstring">
<div class="discussion">
<p>Returns the value of attribute filename</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
6
7
8</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/codemessage.rb', line 6</span>
<span class='kw'>def</span> <span class='id identifier rubyid_filename'>filename</span>
<span class='ivar'>@filename</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<span id=""></span>
<div class="method_details ">
<h3 class="signature " id="linenumber-instance_method">
#<strong>linenumber</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
</h3><div class="docstring">
<div class="discussion">
<p>Returns the value of attribute linenumber</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
6
7
8</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/codemessage.rb', line 6</span>
<span class='kw'>def</span> <span class='id identifier rubyid_linenumber'>linenumber</span>
<span class='ivar'>@linenumber</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<span id="message=-instance_method"></span>
<div class="method_details ">
<h3 class="signature " id="message-instance_method">
#<strong>message</strong> ⇒ <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Returns the value of attribute message</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
7
8
9</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/codemessage.rb', line 7</span>
<span class='kw'>def</span> <span class='id identifier rubyid_message'>message</span>
<span class='ivar'>@message</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<span id=""></span>
<div class="method_details ">
<h3 class="signature " id="messagetype-instance_method">
#<strong>messagetype</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
</h3><div class="docstring">
<div class="discussion">
<p>Returns the value of attribute messagetype</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
6
7
8</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/codemessage.rb', line 6</span>
<span class='kw'>def</span> <span class='id identifier rubyid_messagetype'>messagetype</span>
<span class='ivar'>@messagetype</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
</div>
<div id="instance_method_details" class="method_details_list">
<h2>Instance Method Details</h2>
<div class="method_details first">
<h3 class="signature first" id="<=>-instance_method">
#<strong><=></strong>(other) ⇒ <tt>Boolean</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Checks if two CodeMessage objects are different</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>other</span>
<span class='type'>(<tt><span class='object_link'><a href="" title="CodeMessage (class)">CodeMessage</a></span></tt>)</span>
—
<div class='inline'>
<p>a second CodeMessage instance to compare against self</p>
</div>
</li>
</ul>
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>Boolean</tt>)</span>
—
<div class='inline'>
<p>false if the objects are data-equal, true otherwise</p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/codemessage.rb', line 50</span>
<span class='kw'>def</span> <span class='op'><=></span><span class='lparen'>(</span><span class='id identifier rubyid_other'>other</span><span class='rparen'>)</span>
<span class='id identifier rubyid_f'>f</span> <span class='op'>=</span> <span class='ivar'>@filename</span> <span class='op'><=></span> <span class='id identifier rubyid_other'>other</span><span class='period'>.</span><span class='id identifier rubyid_filename'>filename</span>
<span class='id identifier rubyid_l'>l</span> <span class='op'>=</span> <span class='ivar'>@linenumber</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span> <span class='op'><=></span> <span class='id identifier rubyid_other'>other</span><span class='period'>.</span><span class='id identifier rubyid_linenumber'>linenumber</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span>
<span class='id identifier rubyid_c'>c</span> <span class='op'>=</span> <span class='ivar'>@colnumber</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span> <span class='op'><=></span> <span class='id identifier rubyid_other'>other</span><span class='period'>.</span><span class='id identifier rubyid_colnumber'>colnumber</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span>
<span class='id identifier rubyid_mt'>mt</span> <span class='op'>=</span> <span class='ivar'>@messagetype</span> <span class='op'><=></span> <span class='id identifier rubyid_other'>other</span><span class='period'>.</span><span class='id identifier rubyid_messagetype'>messagetype</span>
<span class='id identifier rubyid_m'>m</span> <span class='op'>=</span> <span class='ivar'>@message</span><span class='lbracket'>[</span><span class='int'>0</span><span class='op'>..</span><span class='int'>10</span><span class='rbracket'>]</span> <span class='op'><=></span> <span class='id identifier rubyid_other'>other</span><span class='period'>.</span><span class='id identifier rubyid_message'>message</span><span class='lbracket'>[</span><span class='int'>0</span><span class='op'>..</span><span class='int'>10</span><span class='rbracket'>]</span>
<span class='kw'>if</span> <span class='id identifier rubyid_f'>f</span> <span class='op'>!=</span> <span class='int'>0</span>
<span class='id identifier rubyid_f'>f</span>
<span class='kw'>elsif</span> <span class='id identifier rubyid_l'>l</span> <span class='op'>!=</span> <span class='int'>0</span>
<span class='id identifier rubyid_l'>l</span>
<span class='kw'>elsif</span> <span class='id identifier rubyid_c'>c</span> <span class='op'>!=</span> <span class='int'>0</span>
<span class='id identifier rubyid_c'>c</span>
<span class='kw'>elsif</span> <span class='id identifier rubyid_mt'>mt</span> <span class='op'>!=</span> <span class='int'>0</span>
<span class='id identifier rubyid_mt'>mt</span>
<span class='kw'>else</span>
<span class='id identifier rubyid_m'>m</span>
<span class='kw'>end</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="eql?-instance_method">
#<strong>eql?</strong>(other) ⇒ <tt>Boolean</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Checks if two CodeMessage objects are equal</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>other</span>
<span class='type'>(<tt><span class='object_link'><a href="" title="CodeMessage (class)">CodeMessage</a></span></tt>)</span>
—
<div class='inline'>
<p>a second CodeMessage instance to compare against self</p>
</div>
</li>
</ul>
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>Boolean</tt>)</span>
—
<div class='inline'>
<p>true if the objects are data-equal, false otherwise</p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
42
43
44</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/codemessage.rb', line 42</span>
<span class='kw'>def</span> <span class='id identifier rubyid_eql?'>eql?</span><span class='lparen'>(</span><span class='id identifier rubyid_other'>other</span><span class='rparen'>)</span>
<span class='lparen'>(</span><span class='kw'>self</span> <span class='op'><=></span> <span class='id identifier rubyid_other'>other</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_zero?'>zero?</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="error?-instance_method">
#<strong>error?</strong> ⇒ <tt>Boolean</tt>
</h3><div class="docstring">
<div class="discussion">
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>Boolean</tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
24
25
26</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/codemessage.rb', line 24</span>
<span class='kw'>def</span> <span class='id identifier rubyid_error?'>error?</span>
<span class='ivar'>@messagetype</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>.*err.*</span><span class='regexp_end'>/i</span></span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="hash-instance_method">
#<strong>hash</strong> ⇒ <tt>Object</tt>
</h3><table class="source_code">
<tr>
<td>
<pre class="lines">
34
35
36</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/codemessage.rb', line 34</span>
<span class='kw'>def</span> <span class='id identifier rubyid_hash'>hash</span>
<span class='id identifier rubyid_inspect'>inspect</span><span class='period'>.</span><span class='id identifier rubyid_hash'>hash</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="inspect-instance_method">
#<strong>inspect</strong> ⇒ <tt>Object</tt>
</h3><table class="source_code">
<tr>
<td>
<pre class="lines">
28
29
30
31
32</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/codemessage.rb', line 28</span>
<span class='kw'>def</span> <span class='id identifier rubyid_inspect'>inspect</span>
<span class='id identifier rubyid_hash'>hash</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
<span class='id identifier rubyid_instance_variables'>instance_variables</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_var'>var</span><span class='op'>|</span> <span class='id identifier rubyid_hash'>hash</span><span class='lbracket'>[</span><span class='id identifier rubyid_var'>var</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</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='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_instance_variable_get'>instance_variable_get</span><span class='lparen'>(</span><span class='id identifier rubyid_var'>var</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
<span class='id identifier rubyid_hash'>hash</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="warning?-instance_method">
#<strong>warning?</strong> ⇒ <tt>Boolean</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Checks if this instance constitutes a warning</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>Boolean</tt>)</span>
—
<div class='inline'>
<p>true if the code message is a warning, false otherwise</p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
20
21
22</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/codemessage.rb', line 20</span>
<span class='kw'>def</span> <span class='id identifier rubyid_warning?'>warning?</span>
<span class='ivar'>@messagetype</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>.*warn.*</span><span class='regexp_end'>/i</span></span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
</div>
</div>
<div id="footer">
Generated on Thu May 18 10:34:59 2023 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.19 (ruby-2.7.0).
</div>
</div>
</body>
</html>