| 1 |
<?xml version="1.0" encoding="iso-8859-1"?> |
| 2 |
<!DOCTYPE html |
| 3 |
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
| 4 |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| 5 |
|
| 6 |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
| 7 |
<head> |
| 8 |
<title>Class: Kwalify::BaseError</title> |
| 9 |
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> |
| 10 |
<meta http-equiv="Content-Script-Type" content="text/javascript" /> |
| 11 |
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" /> |
| 12 |
<script type="text/javascript"> |
| 13 |
// <![CDATA[ |
| 14 |
|
| 15 |
function popupCode( url ) { |
| 16 |
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400") |
| 17 |
} |
| 18 |
|
| 19 |
function toggleCode( id ) { |
| 20 |
if ( document.getElementById ) |
| 21 |
elem = document.getElementById( id ); |
| 22 |
else if ( document.all ) |
| 23 |
elem = eval( "document.all." + id ); |
| 24 |
else |
| 25 |
return false; |
| 26 |
|
| 27 |
elemStyle = elem.style; |
| 28 |
|
| 29 |
if ( elemStyle.display != "block" ) { |
| 30 |
elemStyle.display = "block" |
| 31 |
} else { |
| 32 |
elemStyle.display = "none" |
| 33 |
} |
| 34 |
|
| 35 |
return true; |
| 36 |
} |
| 37 |
|
| 38 |
// Make codeblocks hidden by default |
| 39 |
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" ) |
| 40 |
|
| 41 |
// ]]> |
| 42 |
</script> |
| 43 |
|
| 44 |
</head> |
| 45 |
<body> |
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
<div id="classHeader"> |
| 50 |
<table class="header-table"> |
| 51 |
<tr class="top-aligned-row"> |
| 52 |
<td><strong>Class</strong></td> |
| 53 |
<td class="class-name-in-header">Kwalify::BaseError</td> |
| 54 |
</tr> |
| 55 |
<tr class="top-aligned-row"> |
| 56 |
<td><strong>In:</strong></td> |
| 57 |
<td> |
| 58 |
<a href="../../files/kwalify/errors_rb.html"> |
| 59 |
kwalify/errors.rb |
| 60 |
</a> |
| 61 |
<br /> |
| 62 |
</td> |
| 63 |
</tr> |
| 64 |
|
| 65 |
<tr class="top-aligned-row"> |
| 66 |
<td><strong>Parent:</strong></td> |
| 67 |
<td> |
| 68 |
<a href="KwalifyError.html"> |
| 69 |
KwalifyError |
| 70 |
</a> |
| 71 |
</td> |
| 72 |
</tr> |
| 73 |
</table> |
| 74 |
</div> |
| 75 |
<!-- banner header --> |
| 76 |
|
| 77 |
<div id="bodyContent"> |
| 78 |
|
| 79 |
|
| 80 |
|
| 81 |
<div id="contextContent"> |
| 82 |
|
| 83 |
|
| 84 |
|
| 85 |
</div> |
| 86 |
|
| 87 |
<div id="method-list"> |
| 88 |
<h3 class="section-bar">Methods</h3> |
| 89 |
|
| 90 |
<div class="name-list"> |
| 91 |
<a href="#M000084"><=></a> |
| 92 |
<a href="#M000081">new</a> |
| 93 |
<a href="#M000082">path</a> |
| 94 |
<a href="#M000083">to_s</a> |
| 95 |
</div> |
| 96 |
</div> |
| 97 |
|
| 98 |
</div> |
| 99 |
|
| 100 |
|
| 101 |
<!-- if includes --> |
| 102 |
|
| 103 |
<div id="section"> |
| 104 |
|
| 105 |
|
| 106 |
|
| 107 |
<div id="aliases-list"> |
| 108 |
<h3 class="section-bar">External Aliases</h3> |
| 109 |
|
| 110 |
<div class="name-list"> |
| 111 |
<table summary="aliases"> |
| 112 |
<tr class="top-aligned-row context-row"> |
| 113 |
<td class="context-item-name">to_s</td> |
| 114 |
<td>-></td> |
| 115 |
<td class="context-item-value">_to_s</td> |
| 116 |
</tr> |
| 117 |
<tr class="top-aligned-row context-row"> |
| 118 |
<td class="context-item-name">to_s</td> |
| 119 |
<td>-></td> |
| 120 |
<td class="context-item-value">message</td> |
| 121 |
</tr> |
| 122 |
</table> |
| 123 |
</div> |
| 124 |
</div> |
| 125 |
|
| 126 |
|
| 127 |
<div id="attribute-list"> |
| 128 |
<h3 class="section-bar">Attributes</h3> |
| 129 |
|
| 130 |
<div class="name-list"> |
| 131 |
<table> |
| 132 |
<tr class="top-aligned-row context-row"> |
| 133 |
<td class="context-item-name">column</td> |
| 134 |
<td class="context-item-value"> [RW] </td> |
| 135 |
<td class="context-item-desc"></td> |
| 136 |
</tr> |
| 137 |
<tr class="top-aligned-row context-row"> |
| 138 |
<td class="context-item-name">error_symbol</td> |
| 139 |
<td class="context-item-value"> [RW] </td> |
| 140 |
<td class="context-item-desc"></td> |
| 141 |
</tr> |
| 142 |
<tr class="top-aligned-row context-row"> |
| 143 |
<td class="context-item-name">filename</td> |
| 144 |
<td class="context-item-value"> [RW] </td> |
| 145 |
<td class="context-item-desc"></td> |
| 146 |
</tr> |
| 147 |
<tr class="top-aligned-row context-row"> |
| 148 |
<td class="context-item-name">linenum</td> |
| 149 |
<td class="context-item-value"> [RW] </td> |
| 150 |
<td class="context-item-desc"></td> |
| 151 |
</tr> |
| 152 |
<tr class="top-aligned-row context-row"> |
| 153 |
<td class="context-item-name">path</td> |
| 154 |
<td class="context-item-value"> [RW] </td> |
| 155 |
<td class="context-item-desc"></td> |
| 156 |
</tr> |
| 157 |
<tr class="top-aligned-row context-row"> |
| 158 |
<td class="context-item-name">rule</td> |
| 159 |
<td class="context-item-value"> [RW] </td> |
| 160 |
<td class="context-item-desc"></td> |
| 161 |
</tr> |
| 162 |
<tr class="top-aligned-row context-row"> |
| 163 |
<td class="context-item-name">value</td> |
| 164 |
<td class="context-item-value"> [RW] </td> |
| 165 |
<td class="context-item-desc"></td> |
| 166 |
</tr> |
| 167 |
</table> |
| 168 |
</div> |
| 169 |
</div> |
| 170 |
|
| 171 |
|
| 172 |
|
| 173 |
<!-- if method_list --> |
| 174 |
<div id="methods"> |
| 175 |
<h3 class="section-bar">Public Class methods</h3> |
| 176 |
|
| 177 |
<div id="method-M000081" class="method-detail"> |
| 178 |
<a name="M000081"></a> |
| 179 |
|
| 180 |
<div class="method-heading"> |
| 181 |
<a href="#M000081" class="method-signature"> |
| 182 |
<span class="method-name">new</span><span class="method-args">(message="", path=nil, value=nil, rule=nil, error_symbol=nil)</span> |
| 183 |
</a> |
| 184 |
</div> |
| 185 |
|
| 186 |
<div class="method-description"> |
| 187 |
<p><a class="source-toggle" href="#" |
| 188 |
onclick="toggleCode('M000081-source');return false;">[Source]</a></p> |
| 189 |
<div class="method-source-code" id="M000081-source"> |
| 190 |
<pre> |
| 191 |
<span class="ruby-comment cmt"># File kwalify/errors.rb, line 23</span> |
| 192 |
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">message</span>=<span class="ruby-value str">""</span>, <span class="ruby-identifier">path</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">value</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">rule</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">error_symbol</span>=<span class="ruby-keyword kw">nil</span>) |
| 193 |
<span class="ruby-keyword kw">super</span>(<span class="ruby-identifier">message</span>) |
| 194 |
<span class="ruby-ivar">@path</span> = <span class="ruby-identifier">path</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Array</span>) <span class="ruby-operator">?</span> <span class="ruby-value str">'/'</span><span class="ruby-operator">+</span><span class="ruby-identifier">path</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">'/'</span>) <span class="ruby-operator">:</span> <span class="ruby-identifier">path</span> |
| 195 |
<span class="ruby-ivar">@rule</span> = <span class="ruby-identifier">rule</span> |
| 196 |
<span class="ruby-ivar">@value</span> = <span class="ruby-identifier">value</span> |
| 197 |
<span class="ruby-ivar">@error_symbol</span> = <span class="ruby-identifier">error_symbol</span> |
| 198 |
<span class="ruby-keyword kw">end</span> |
| 199 |
</pre> |
| 200 |
</div> |
| 201 |
</div> |
| 202 |
</div> |
| 203 |
|
| 204 |
<h3 class="section-bar">Public Instance methods</h3> |
| 205 |
|
| 206 |
<div id="method-M000084" class="method-detail"> |
| 207 |
<a name="M000084"></a> |
| 208 |
|
| 209 |
<div class="method-heading"> |
| 210 |
<a href="#M000084" class="method-signature"> |
| 211 |
<span class="method-name"><=></span><span class="method-args">(ex)</span> |
| 212 |
</a> |
| 213 |
</div> |
| 214 |
|
| 215 |
<div class="method-description"> |
| 216 |
<p><a class="source-toggle" href="#" |
| 217 |
onclick="toggleCode('M000084-source');return false;">[Source]</a></p> |
| 218 |
<div class="method-source-code" id="M000084-source"> |
| 219 |
<pre> |
| 220 |
<span class="ruby-comment cmt"># File kwalify/errors.rb, line 49</span> |
| 221 |
<span class="ruby-keyword kw">def</span> <span class="ruby-operator"><=></span>(<span class="ruby-identifier">ex</span>) |
| 222 |
<span class="ruby-comment cmt">#return @linenum <=> ex.linenum</span> |
| 223 |
<span class="ruby-identifier">v</span> = <span class="ruby-value">0</span> |
| 224 |
<span class="ruby-identifier">v</span> = <span class="ruby-ivar">@linenum</span> <span class="ruby-operator"><=></span> <span class="ruby-identifier">ex</span>.<span class="ruby-identifier">linenum</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@linenum</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">ex</span>.<span class="ruby-identifier">linenum</span> |
| 225 |
<span class="ruby-identifier">v</span> = <span class="ruby-ivar">@column</span> <span class="ruby-operator"><=></span> <span class="ruby-identifier">ex</span>.<span class="ruby-identifier">column</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">v</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span> <span class="ruby-operator">&&</span> <span class="ruby-ivar">@column</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">ex</span>.<span class="ruby-identifier">column</span> |
| 226 |
<span class="ruby-identifier">v</span> = <span class="ruby-ivar">@path</span> <span class="ruby-operator"><=></span> <span class="ruby-identifier">ex</span>.<span class="ruby-identifier">path</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">v</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span> |
| 227 |
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">v</span> |
| 228 |
<span class="ruby-keyword kw">end</span> |
| 229 |
</pre> |
| 230 |
</div> |
| 231 |
</div> |
| 232 |
</div> |
| 233 |
|
| 234 |
<div id="method-M000082" class="method-detail"> |
| 235 |
<a name="M000082"></a> |
| 236 |
|
| 237 |
<div class="method-heading"> |
| 238 |
<a href="#M000082" class="method-signature"> |
| 239 |
<span class="method-name">path</span><span class="method-args">()</span> |
| 240 |
</a> |
| 241 |
</div> |
| 242 |
|
| 243 |
<div class="method-description"> |
| 244 |
<p><a class="source-toggle" href="#" |
| 245 |
onclick="toggleCode('M000082-source');return false;">[Source]</a></p> |
| 246 |
<div class="method-source-code" id="M000082-source"> |
| 247 |
<pre> |
| 248 |
<span class="ruby-comment cmt"># File kwalify/errors.rb, line 33</span> |
| 249 |
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">path</span> |
| 250 |
<span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@path</span> <span class="ruby-operator">==</span> <span class="ruby-value str">''</span> <span class="ruby-operator">?</span> <span class="ruby-value str">"/"</span> <span class="ruby-operator">:</span> <span class="ruby-ivar">@path</span> |
| 251 |
<span class="ruby-keyword kw">end</span> |
| 252 |
</pre> |
| 253 |
</div> |
| 254 |
</div> |
| 255 |
</div> |
| 256 |
|
| 257 |
<div id="method-M000083" class="method-detail"> |
| 258 |
<a name="M000083"></a> |
| 259 |
|
| 260 |
<div class="method-heading"> |
| 261 |
<a href="#M000083" class="method-signature"> |
| 262 |
<span class="method-name">to_s</span><span class="method-args">()</span> |
| 263 |
</a> |
| 264 |
</div> |
| 265 |
|
| 266 |
<div class="method-description"> |
| 267 |
<p><a class="source-toggle" href="#" |
| 268 |
onclick="toggleCode('M000083-source');return false;">[Source]</a></p> |
| 269 |
<div class="method-source-code" id="M000083-source"> |
| 270 |
<pre> |
| 271 |
<span class="ruby-comment cmt"># File kwalify/errors.rb, line 40</span> |
| 272 |
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_s</span> |
| 273 |
<span class="ruby-identifier">s</span> = <span class="ruby-value str">''</span> |
| 274 |
<span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-ivar">@filename</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">":"</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@filename</span> |
| 275 |
<span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"#{@linenum}:#{@column} "</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@linenum</span> |
| 276 |
<span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"[#{path()}] "</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@path</span> |
| 277 |
<span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">_to_s</span>() |
| 278 |
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">s</span> |
| 279 |
<span class="ruby-keyword kw">end</span> |
| 280 |
</pre> |
| 281 |
</div> |
| 282 |
</div> |
| 283 |
</div> |
| 284 |
|
| 285 |
|
| 286 |
</div> |
| 287 |
|
| 288 |
|
| 289 |
</div> |
| 290 |
|
| 291 |
|
| 292 |
<div id="validator-badges"> |
| 293 |
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p> |
| 294 |
</div> |
| 295 |
|
| 296 |
</body> |
| 297 |
</html> |