1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5 <title>options_check_int (OptionHandler)</title>
6 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
7 <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
9 <body class="standalone-code">
10 <pre><span class="ruby-comment cmt"># File biopieces.rb, line 408</span>
11 <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">options_check_int</span>(<span class="ruby-identifier">cast</span>)
12 <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">cast</span>[<span class="ruby-identifier">:type</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">'int'</span> <span class="ruby-keyword kw">and</span> <span class="ruby-ivar">@options</span>.<span class="ruby-identifier">has_key?</span> <span class="ruby-identifier">cast</span>[<span class="ruby-identifier">:long</span>]
13 <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@options</span>[<span class="ruby-identifier">cast</span>[<span class="ruby-identifier">:long</span>]].<span class="ruby-identifier">is_a?</span> <span class="ruby-constant">Integer</span>
14 <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-node">"Argument to --#{cast[:long]} must be an integer, not '#{@options[cast[:long]]}'"</span>
15 <span class="ruby-keyword kw">end</span>
16 <span class="ruby-keyword kw">end</span>
17 <span class="ruby-keyword kw">end</span></pre>