<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Ruby Ground Zero</title>
	<atom:link href="http://rubyzero.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://rubyzero.wordpress.com</link>
	<description>Basic Articles About The &#039;Ruby Programming Language&#039;</description>
	<lastBuildDate>Sat, 05 Sep 2009 01:33:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='rubyzero.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://1.gravatar.com/blavatar/fdc2a09279c1308be969536a39360a1a?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>Ruby Ground Zero</title>
		<link>http://rubyzero.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://rubyzero.wordpress.com/osd.xml" title="Ruby Ground Zero" />
	<atom:link rel='hub' href='http://rubyzero.wordpress.com/?pushpress=hub'/>
		<item>
		<title>How to Declare a Ruby &#8216;_variable=value&#8217;</title>
		<link>http://rubyzero.wordpress.com/2009/08/23/how-to-declare-ruby-_variable/</link>
		<comments>http://rubyzero.wordpress.com/2009/08/23/how-to-declare-ruby-_variable/#comments</comments>
		<pubDate>Sun, 23 Aug 2009 18:55:00 +0000</pubDate>
		<dc:creator>Arizona Cannabis Dispensary</dc:creator>
				<category><![CDATA[Ruby Articles]]></category>
		<category><![CDATA[declare]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[variable]]></category>

		<guid isPermaLink="false">http://rubyzero.wordpress.com/2009/08/23/how-to-declare-a-ruby-_variablevalue/</guid>
		<description><![CDATA[Technorati Tags: Ruby,Ruby _variable,Ruby _variable.class,Ruby Programming Language,irb,Ruby Interactive Intepreter,Ruby CONSTANT,Ruby Object class,Ruby kind_of? method,Ruby to_s() method,Ruby binary base 2,Ruby decimal base 10,Ruby baby 1961 1.) From the command line, invoke the &#8216;&#160;irb&#160;&#8217; at the Ruby installation directory. c:\ruby&#62;irb irb(main):001:0&#62; 2.) After initializing the &#8216;&#160;irb&#160;&#8217; as shown above, next type an instruction to the &#8216;&#160;irb&#160;&#8217; declaring [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rubyzero.wordpress.com&amp;blog=9089030&amp;post=19&amp;subd=rubyzero&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div class="wlWriterEditableSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:74538a18-a02f-4cfb-8409-0076fb3d8805" style="float:none;display:inline;margin:0;padding:0;">Technorati Tags: <a href="http://technorati.com/tags/Ruby" rel="tag">Ruby</a>,<a href="http://technorati.com/tags/Ruby+_variable" rel="tag">Ruby _variable</a>,<a href="http://technorati.com/tags/Ruby+_variable.class" rel="tag">Ruby _variable.class</a>,<a href="http://technorati.com/tags/Ruby+Programming+Language" rel="tag">Ruby Programming Language</a>,<a href="http://technorati.com/tags/irb" rel="tag">irb</a>,<a href="http://technorati.com/tags/Ruby+Interactive+Intepreter" rel="tag">Ruby Interactive Intepreter</a>,<a href="http://technorati.com/tags/Ruby+CONSTANT" rel="tag">Ruby CONSTANT</a>,<a href="http://technorati.com/tags/Ruby+Object+class" rel="tag">Ruby Object class</a>,<a href="http://technorati.com/tags/Ruby+kind_of%3f+method" rel="tag">Ruby kind_of? method</a>,<a href="http://technorati.com/tags/Ruby+to_s()+method" rel="tag">Ruby to_s() method</a>,<a href="http://technorati.com/tags/Ruby+binary+base+2" rel="tag">Ruby binary base 2</a>,<a href="http://technorati.com/tags/Ruby+decimal+base+10" rel="tag">Ruby decimal base 10</a>,<a href="http://technorati.com/tags/Ruby+baby+1961" rel="tag">Ruby baby 1961</a></div>
<div style="font-family:Eurostile, serif, sans-serif;font:Eurostyle;text-align:justify;">
<div>
<hr /> <a href="http://hempaz.com/cannabis.aspx"> <img alt="Mitsubishi Zero 25 courtesy of Nitroplanes dot com" src="http://lh6.ggpht.com/_DSBe3y9bUtg/SpFyV5wJjHI/AAAAAAAAB98/Qks8f9NEPgk/s800/Nitroplanes-Mitsubishi-Zero25_160_x_106.png" style="float:left;width:160px;border:2px blue solid;margin:0 10px 5px 0;" /></a>  <!--How to convert a Ruby '_variable=value' from 'common' base (10) numeral set to 'binary' base (2) numeral set Begin-->
<p> <span>1.) From the command line, invoke the &#8216;&nbsp;<abbr title="Ruby Interactive Interpreter">irb</abbr>&nbsp;&#8217; at the Ruby installation directory.</span> </p>
<p> <span>c:\ruby&#62;irb</span><br /> <span>irb(main):001:0&#62;</span> </p>
<p> <span>2.) After initializing the &#8216;&nbsp;<abbr title="Ruby Interactive Interpreter">irb</abbr>&nbsp;&#8217; as shown above, next type an instruction to the &#8216;&nbsp;<abbr title="Ruby Interactive Interpreter">irb</abbr>&nbsp;&#8217; declaring a Ruby &#8216;_variable&#8217;.</span> </p>
<p> <span>When declaring a Ruby &#8216;_variable&#8217;, use any combination of &#8216;cap(s)&#8217;, numerals, or small case letters with one exception.</span> </p>
<p> <span>Use the &#8216;underscore&#8217; character to begin the name of your Ruby &#8216;_variable&#8217; and DO NOT use a &#8216;cap&#8217; for the first character of the &#8216;_variable&#8217; name.</span> </p>
<p> <span>Recall from the accompanying tutorial on Ruby <a href="http://rubyzero.wordpress.com/2009/08/20/ruby-constant-declare/">constant</a>(s), a Ruby constant is<br />
 declared with a &#8216;cap&#8217; as the first character of the constant name.</span> </p>
<p> <span>The convention used throughout this set of tutorials is to declare a Ruby constant as &#8216;ALLCAPS&#8217;. The &#8216;irb&#8217; will thus return verification of the declaration of your<br />
 Ruby &#8216;_variable&#8217; on the next &#61;&#62; line.</span> </p>
<p> <span>irb(main):001:0&#62;_variable54=010160</span></br> <span>=&#62;4208</span>  </p>
<p> <span>3.) If you attempt to declare the same &#8216;_variable=value&#8217; twice, an error message will NOT be displayed by the &#8216;&nbsp;<abbr title="Ruby Interactive Interpreter">irb</abbr>&nbsp;&#8217; as it does so when spying the &#8216;double declaration&#8217; of a Ruby<br />
 constant.</span> </p>
<p> <span>However, as with a Ruby constant, if you do decide to change your &#8216;_variable=value&#8217; mid-stream while writing your program lines Ruby will most graciously follow<br />
 through with your thought and allow such change(s) to occur.</span> </p>
<p> <span>In the spirit of simple collaboration between the &#8216;&nbsp;<abbr title="Ruby Interactive Interpreter">irb</abbr>&nbsp;&#8217; and the code writer, when coding with Ruby&#8230;YOU win!</span> </p>
<p> <span>irb(main):002:0&#62;_variable54=010160</span><br /> <span>(irb):2: no warning: null</span><br /> <span>=&#62;4208</span>  </p>
<p> </span>4.) From the &#8216;looks&#8217; of your declared &#8216;_variable=value&#8217;, the &#8216;&nbsp;<abbr title="Ruby Interactive Interpreter">irb</abbr>&nbsp;&#8217; has assigned the &#8216;type&#8217; xxxxx to your &#8216;_variable54&#8242; at initialization.</span> </p>
<p> <span>There is no need to explicitly declare the &#8216;type&#8217; when declaring your &#8216;_variable=value&#8217; in Ruby.</span> </p>
<p> </span>In an interesting twist of policy to other declarative and &#8216;strongly&#8217; typed languages Ruby does not require the declaration of a &#8216;type&#8217; when declaring a<br />
 &#8216;_variable=value&#8217;, but rather interprets the &#8216;_variable=value&#8217; as it is &#8216;seen&#8217; by the &#8216;&nbsp;<abbr title="Ruby Interactive Interpreter">irb</abbr>&nbsp;&#8217; at initialization.</span> </p>
<p> <span>To check the &#8216;type&#8217; of your new &#8216;_variable=value&#8217; initialized by the &#8216;&nbsp;<abbr title="Ruby Interactive Interpreter">irb</abbr>&nbsp;&#8217; when declaring your &#8216;_variable=value&#8217;, do request the &#8216;class&#8217; of the newly initialized &#8216;_variable=value&#8217;, as<br />
 follows:</span> </p>
<p> <span>irb(main):003:0&#62;_variable54.class</span><br /> <span>=&#62;Fixnum</span>  </p>
<p> <span>5.) The &#8216;&nbsp;<abbr title="Ruby Interactive Interpreter">irb</abbr>&nbsp;&#8217; returns the<br />
 &#8216;type&#8217; of &#8216;_variable=value&#8217; initialized by the &#8216;&nbsp;<abbr title="Ruby Interactive Interpreter">irb</abbr>&nbsp;&#8217; upon your declaration.</span> </p>
<p> <span>6.) Neither is it necessary when coding with &#8216;Ruby&#8217; to worry about the &#8216;type&#8217; when changing your Ruby &#8216;_variable=value&#8217; mid-stream.</span></p>
<p> <span>Ruby will dynamically change the &#8216;type&#8217; for your Ruby &#8216;_variable=value&#8217; to match the intepreted &#8216;type&#8217; of the new &#8216;value&#8217; assigned.</span></p>
<p> <span>In this case, a &#8216;Fixed Number&#8217;.</span></p>
<p> <span>Alternately, the &#8216;kind_of?&#8217; method of the Object class may be invoked, as well, to &#8216;root out&#8217; the true interpreted &#8216;type&#8217;.</span></p>
<p> <span>If you suspect your Ruby &#8216;_variable=value&#8217; has been given a certain &#8216;type&#8217; by the &#8216;&nbsp;<abbr title="Ruby Interactive Interpreter">irb</abbr>&nbsp;&#8217; at initialization, then offer the following line(s) of code to the &#8216;&nbsp;<abbr title="Ruby </p>
<p>Interactive Interpreter&#8221;>irb</abbr>&nbsp;&#8217; for clarification.</span> </p>
<p> <span>irb(main):004:0&#62;_variable54.kind_of? Integer</span><br /> <span>=&#62;true</span> </p>
<p> <span>irb(main):005:0&#62;CONSTANT.kind_of? Fixnum</span><br /> <span>=&#62;true</span> </p>
<p> <span>irb(main):006:0&#62;CONSTANT.kind_of? String</span><br /> <span>=&#62;false</span> </p>
<p> <span>7.) The &#8216;&nbsp;<abbr title="Ruby Interactive Interpreter">irb</abbr>&nbsp;&#8217; will return<br />
 a &#8216;Boolean&#8217; response to your inquiry.</span> </p>
<p> <span>8.) Have a little fun with your &#8216;_variable=value&#8217; by converting the &#8216;value&#8217; of your &#8216;_variable&#8217; to a base (2) numeral and back to base (10) using the Ruby Object<br />
 class &#8216;to_s()&#8217; method.</span></p>
<p> <span>The Ruby &#8216;to_s()&#8217; method will accept as an argument any &#8216;base numeral set&#8217; between (1) and (36).</span> </p>
<p> <span>irb(main):007:0&#62;4208.to_s(2)</span><br /> <span>=&#62;&#8221;1000001110000&#8243;</span> </p>
<p> <span>irb(main):008:0&#62;4208.to_s(10)</span><br /> <span>=&#62;&#8221;4208&#8243;</span> </p>
<p>  <!--How to convert a Ruby '_variable=value' from 'common' base (10) numeral set to 'binary' base (2) numeral set Begin-->  <span>See also:</span>  <!--How to Declare a 'Visual Basic' variable Begin-->  <!--How to Declare a 'Visual Basic' variable End-->  <!--How to Declare a 'Php' variable Begin-->  <!--How to Declare a 'Php' variable End-->
<p> <span style="font-weight:bold;">Acknowledgment(s):</span> </p>
<p> <span>This article was written after reviewing tutorial(s) listed at&nbsp;<a href="http://www.techotopia.com/index.php/Ruby_Essentials">Techtopia</a>&nbsp;dot com.</span> </p>
<p>Photo courtesy of <a href="http://www.nitroplanes.com/">Nitroplanes</a>&nbsp;dot com.</p>
<p> <span>Give generously to the Libertarian effort to abolish the current prohibition against the planting of cannabis and hemp varietals in your county, state, province or<br />
 country for the continued benefit of being able to listen to our songbirds &#39;chirp&#39;.</span> <span>&#8216;<a href="http://hempaz.com/Documents/2008801t_VOHO_EFA_Table.aspx">Birds Know Omega3™</a>&#8216;</span>
<p> <span style="font-weight:bold;">Source:&nbsp;<a href="http://www.guardian.co.uk/environment/2008/jun/08/birds.linnet">Cannabis Achene Bird Feed Magazine</a></span> </p>
</p></div>
<div align="center">
<table border="3" cellspacing="0" style="background-color:white;padding:5px;">
<tbody>
<tr>
<td><img alt="Hempaz-Google Group" height="26" src="http://groups.google.com/groups/img/3nb/groups_bar.gif" width="132" /></td>
</tr>
<tr>
<td style="padding-left:5px;"><b>Subscribe to Hempaz-Google Group</b></td>
</tr>
<tr>
<td style="padding-left:5px;">Email:       </td>
</tr>
<tr>
<td align="right"><a href="http://groups.google.com/group/hempaz?hl=en">Visit this group</a> </td>
</tr>
</tbody>
</table></div>
<div class="featureContainer" style="text-align:left;">
<p> <a href="http://www.zazzle.com/ladies_wet_tee_garden_spaghetti_strap_tshirt-235071284209924032?group=womens&amp;lifeStyle=all&amp;rf=238675003811954431">Clik to Purchase Ladies Wet Tee™ Brand Spaghetti Strap Garden Top</a></p>
</p></div>
<div> <span style="font-weight:bold;">Feature Video:&nbsp;<a href="http://hempaz.com/Documents/Ruby-Ground-Zero-variables.aspx">Canadian Ruby Baby (1961)</a></span>  </div>
<hr />
<div class="videoContainer" style="text-align:center;">   </div>
<div class="sourceContainer" style="text-align:center;">
<p> <span style="font-weight:bold;">Source:&nbsp;<a href="http://www.livevideo.com/video/embedLink/98A2454850044C75BB6C5CE865E8E731/864928/-rock-beatles-ruby-baby-19.aspx">From the LP The Beatles &#8216;Very Together&#8217; released by Polydor Records of Canada in 1969</a></span></p>
</p></div>
<div>
<p> <span><a href="http://www.zazzle.com/ladies_wet_tee_garden_spaghetti_strap_tshirt-235071284209924032?group=womens&amp;lifeStyle=all&amp;rf=238675003811954431">Clik to Purchase Ladies Wet Tee™ Brand Spaghetti Strap Garden Top</a></span> </p>
<p style="text-align:center;"> <span>or,&#8230;</span> </p>
</p></div>
<div id="don1000100ate" style="text-align:center;">
<h3>Make a donation to the Medical Marijuana Initiative (MMI)™ Today!</h3>
</p></div>
<p> <!--MMI Secure Donation Link URL Begin-->
<div style="text-align:center;font-weight:bold;font-size:85%;"> <span>Clik&nbsp;<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&amp;hosted_button_id=7683956">here</a>&nbsp;to donate<br />
 securely to the Medical Marijuana Initiative (<a href="http://hempaz.com/mmi.aspx">MMI</a>)™</span> </div>
<p> <!--MMI Secure Donation Link URL End--> <!--MMI Secure Donation FORM Begin--><br />
<h3 style="text-align:center;">Payments processed by Azjaguar Design &amp; Manf Co. via PayPal, Inc.</h3>
<div align="center">     <img border="0" alt="" width="1" src="https://www.paypal.com/en_US/i/scr/pixel.gif" height="1" />  </div>
<p> <!--MMI Secure Donation FORM End--> <!--Robert Hempaz, PhD. Trichometry™ Signature Begin-->
<div style="font-size:105%;text-align:left;">
<p> <span lang="es-mx" title="Gracias por su visitita, adios y...(sp.-usted) = Thank you for your short visit, travel with God and...(en.)">Gracias por su visitita, adios<br />
 y&#8230;</span> </p>
</p></div>
<div style="font-size:105%;text-align:center;">
<p> <span lang="es-mx" title="¡Buenas suerte a vosotros! (sp.-ustedes) = Good luck to you all (en.)">¡Buenas suerte a vosotros!</span> </p>
</p></div>
<div style="font-size:85%;text-align:right;">
<p> <span>Robert&nbsp;<a href="http://hempaz.com/docmap.aspx">Hempaz</a>, PhD. Trichometry™</span><br /> <span>Blogged with Microsoft Windows Live Writer</span> </p>
</p></div>
<p> <!--Robert Hempaz, PhD. Trichometry™ Signature End-->
<div style="text-align:center;">
<p> <span>Return to Hemp Arizona ( <a href="http://hempaz.com/sitemap.aspx">USA</a> )  Sitemap</span> </p>
</p></div>
</p></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rubyzero.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rubyzero.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rubyzero.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rubyzero.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rubyzero.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rubyzero.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rubyzero.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rubyzero.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rubyzero.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rubyzero.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rubyzero.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rubyzero.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rubyzero.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rubyzero.wordpress.com/19/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rubyzero.wordpress.com&amp;blog=9089030&amp;post=19&amp;subd=rubyzero&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rubyzero.wordpress.com/2009/08/23/how-to-declare-ruby-_variable/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/398d7c6573256e8ba71c4eeccda3c1d4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">getcapital</media:title>
		</media:content>

		<media:content url="http://lh6.ggpht.com/_DSBe3y9bUtg/SpFyV5wJjHI/AAAAAAAAB98/Qks8f9NEPgk/s800/Nitroplanes-Mitsubishi-Zero25_160_x_106.png" medium="image">
			<media:title type="html">Mitsubishi Zero 25 courtesy of Nitroplanes dot com</media:title>
		</media:content>

		<media:content url="http://groups.google.com/groups/img/3nb/groups_bar.gif" medium="image">
			<media:title type="html">Hempaz-Google Group</media:title>
		</media:content>

		<media:content url="https://www.paypal.com/en_US/i/scr/pixel.gif" medium="image" />
	</item>
		<item>
		<title>How to Declare a Ruby &#8216;CONSTANT=value&#8217;</title>
		<link>http://rubyzero.wordpress.com/2009/08/20/ruby-constant-declare/</link>
		<comments>http://rubyzero.wordpress.com/2009/08/20/ruby-constant-declare/#comments</comments>
		<pubDate>Thu, 20 Aug 2009 07:27:00 +0000</pubDate>
		<dc:creator>Arizona Cannabis Dispensary</dc:creator>
				<category><![CDATA[Ruby Articles]]></category>
		<category><![CDATA[constant]]></category>
		<category><![CDATA[declare]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://rubyzero.wordpress.com/?p=3</guid>
		<description><![CDATA[Technorati Tags: Ruby,Ruby _variable,Ruby _variable.class,Ruby Programming Language,irb,Ruby Interactive Intepreter,Ruby CONSTANT,Ruby Object class,Ruby kind_of? method,Ruby to_s() method,Ruby binary base 2,Ruby decimal base 10,Cream,Cream Live,Elder Cream,Albert Hall 2005,Ginger Baker,Eric Clapton,Disraeli Gears,Sunshine of Your Love 1.) From the command line, invoke the &#8216;&#160;irb&#160;&#8217; at the Ruby installation directory. c:\ruby&#62;irb irb(main):001:0&#62; 2.) After initializing the &#8216;&#160;irb&#160;&#8217; as shown above, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rubyzero.wordpress.com&amp;blog=9089030&amp;post=3&amp;subd=rubyzero&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div style="font-family:Eurostile, Serif, Sans-Serif;font:Eurostyle;text-align:justify;background-color:##FFFFE6;border:2px red groove;padding:.5em;">
<div class="wlWriterEditableSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:6d897aa0-676a-4dd7-951b-cc07ada66976" style="float:none;display:inline;margin:0;padding:0;">Technorati Tags: <a href="http://technorati.com/tags/Ruby" rel="tag">Ruby</a>,<a href="http://technorati.com/tags/Ruby+_variable" rel="tag">Ruby _variable</a>,<a href="http://technorati.com/tags/Ruby+_variable.class" rel="tag">Ruby _variable.class</a>,<a href="http://technorati.com/tags/Ruby+Programming+Language" rel="tag">Ruby Programming Language</a>,<a href="http://technorati.com/tags/irb" rel="tag">irb</a>,<a href="http://technorati.com/tags/Ruby+Interactive+Intepreter" rel="tag">Ruby Interactive Intepreter</a>,<a href="http://technorati.com/tags/Ruby+CONSTANT" rel="tag">Ruby CONSTANT</a>,<a href="http://technorati.com/tags/Ruby+Object+class" rel="tag">Ruby Object class</a>,<a href="http://technorati.com/tags/Ruby+kind_of%3f+method" rel="tag">Ruby kind_of? method</a>,<a href="http://technorati.com/tags/Ruby+to_s()+method" rel="tag">Ruby to_s() method</a>,<a href="http://technorati.com/tags/Ruby+binary+base+2" rel="tag">Ruby binary base 2</a>,<a href="http://technorati.com/tags/Ruby+decimal+base+10" rel="tag">Ruby decimal base 10</a>,<a href="http://technorati.com/tags/Cream" rel="tag">Cream</a>,<a href="http://technorati.com/tags/Cream+Live" rel="tag">Cream Live</a>,<a href="http://technorati.com/tags/Elder+Cream" rel="tag">Elder Cream</a>,<a href="http://technorati.com/tags/Albert+Hall+2005" rel="tag">Albert Hall 2005</a>,<a href="http://technorati.com/tags/Ginger+Baker" rel="tag">Ginger Baker</a>,<a href="http://technorati.com/tags/Eric+Clapton" rel="tag">Eric Clapton</a>,<a href="http://technorati.com/tags/Disraeli+Gears" rel="tag">Disraeli Gears</a>,<a href="http://technorati.com/tags/Sunshine+of+Your+Love" rel="tag">Sunshine of Your Love</a></div>
<hr />
<div>         <a href="http://hempaz.com/Documents/Ruby-Constant-Ground-Zero.aspx">         <img alt="Ruby Throat Hummer" src="http://lh3.ggpht.com/_DSBe3y9bUtg/SqAtfxAre4I/AAAAAAAACGc/0YvrXpE2ztA/s800/ruby-throat-hummingbird_160_x_110.png.jpg" style="float:left;width:180px;border:2px blue solid;margin:0 10px 5px 0;" /></a>                    <!--How to declare a Ruby 'CONSTANT=value' Begin-->
<p>           <span>1.) From the command line, invoke the &#8216;&nbsp;<abbr title="Ruby Interactive Interpreter">irb</abbr>&nbsp;&#8217; at the Ruby installation directory.</span>           </p>
<p>           <span>c:\ruby&#62;irb</span><br />           <span>irb(main):001:0&#62;</span>         </p>
<p>           <span>2.) After initializing the &#8216;&nbsp;<abbr title="Ruby Interactive Interpreter">irb</abbr>&nbsp;&#8217; as shown above, next type an instruction to the &#8216;&nbsp;<abbr title="Ruby Interactive Interpreter">irb</abbr>&nbsp;&#8217; declaring a Ruby &#8216;CONSTANT&#8217;.</span>           </p>
<p>           <span>irb(main):001:0&gt;ruby CONSTANT=69</span><br />           <span>=&gt;69</span>           </p>
<p>           <span>When declaring a Ruby constant, use all &#8216;cap(s)&#8217; or begin with a &#8216;cap&#8217; with no exceptions.</span>           <span>The convention used throughout this set of tutorials is to declare a Ruby constant as &#39;ALLCAPS&#39;.</span>           <span>The &#8216;irb&#8217; will thus return verification of the declaration of your Ruby constant on the next =&gt; line.</span></p>
<p>       <span>3.) If you attempt to declare the same &#8216;CONSTANT&#8217; twice, an error message will be displayed by the &#8216;irb&#8217;.</span>       <span>However, if you do decide to change your &#8216;CONSTANT=value&#8217; mid-stream while writing your program lines Ruby will allow such change(s).</span>       <span>In the spirit of simple collaboration between the &#8216;irb&#8217; and the code writer, when coding with Ruby&#8230;YOU win!</span>       </p>
<p>irb(main):002:0&gt;CONSTANT=69    <br />(irb):2: warning: already initialized constant CONSTANT     <br />=&gt;69</p>
<p> <span>4.) From the &#8216;looks&#8217; of your declared &#8216;CONSTANT&#8217;, the &#8216;irb&#8217; has assigned the proper &#8216;type&#8217; to your &#8216;CONSTANT&#8217; at initialization.</span> <span>There is no need to explicitly declare the &#8216;type&#8217; when declaring your &#8216;CONSTANT&#8217;.</span> </p>
<p><span>In an interesting twist of policy to other declarative and &#8216;strongly&#8217; typed languages Ruby does not require the declaration of a &#8216;type&#8217; when declaring a &#8216;CONSTANT&#8217;, but rather interprets the &#8216;CONSTANT&#8217; as it is &#8216;seen&#8217; by the &#8216;irb&#8217; at initialization.</span> </p>
<p>To check the &#8216;type&#8217; of your new &#8216;CONSTANT&#8217; initialized by the &#8216;irb&#8217; when declaring your &#8216;CONSTANT=value&#8217;, do request the &#8216;class&#8217; of the newly initialized &#8216;CONSTANT=value&#8217;, as follows:</p>
<p>irb(main):003:0&gt;CONSTANT.class    <br />=&gt;Fixnum</p>
<p>5.) The &#8216;irb&#8217; returns the &#8216;type&#8217; of &#8216;CONSTANT=value&#8217; initialized by the &#8216;irb&#8217; upon your declaration.</p>
<p> <span>6.) Neither is it necessary when coding with &#8216;Ruby&#8217; to worry about the &#8216;type&#8217; when changing your Ruby &#8216;CONSTANT=value&#8217; mid-stream.</span></p>
<p> <span>Ruby will dynamically change the &#8216;type&#8217; for your Ruby &#8216;CONSTANT=value&#8217; to match the interpreted &#8216;type&#8217; of the new &#8216;value&#8217; assigned.</span></p>
<p> <span>In this case, a &#8216;Fixed Number&#8217;.</span></p>
<p> <span>Alternately, the &#8216;kind_of?&#8217; method of the Object class may be invoked, as well, to &#8216;root out&#8217; the true interpreted &#8216;type&#8217;.</span></p>
<p> <span>If you suspect your Ruby &#8216;CONSTANT=value&#8217; has been given a certain &#8216;type&#8217; by the &#8216;&nbsp;<abbr title="Ruby Interactive Interpreter">irb</abbr>&nbsp;&#8217; at initialization, then offer the following line(s) of code to the &#8216;&nbsp;<abbr title="Ruby Interactive Interpreter">irb</abbr>&nbsp;&#8217; for clarification.</span> </p>
<p> <span>irb(main):004:0&#62;CONSTANT.kind_of? Integer</span><br /> <span>=&#62;true</span> </p>
<p> <span>irb(main):005:0&#62;CONSTANT.kind_of? Fixnum</span><br /> <span>=&#62;true</span> </p>
<p> <span>irb(main):006:0&#62;CONSTANT.kind_of? String</span><br /> <span>=&#62;false</span> </p>
<p> <span>7.) The &#8216;&nbsp;<abbr title="Ruby Interactive Interpreter">irb</abbr>&nbsp;&#8217; will return a &#8216;Boolean&#8217; response to your inquiry.</span> </p>
<p> <span>8.) Have a little fun with your &#8216;CONSTANT=value&#8217; by converting the &#8216;value&#8217; of your &#8216;CONSTANT&#8217; to a base (2) numeral and back to base (10) using the Ruby Object class &#8216;to_s()&#8217; method.</span></p>
<p> <span>The Ruby &#8216;to_s()&#8217; method will accept as an argument any &#8216;base numeral set&#8217; between (1) and (36).</span> </p>
<p> <span>irb(main):007:0&#62;4208.to_s(2)</span><br /> <span>=&#62;&#8221;1000001110000&#8243;</span> </p>
<p> <span>irb(main):008:0&#62;4208.to_s(10)</span><br /> <span>=&#62;&#8221;4208&#8243;</span>  </p>
<p> <!--How to declare a Ruby 'CONSTANT=value' End-->   <span>See also:</span> <!--How to Declare a 'Visual Basic' variable Begin--> <!--How to Declare a 'Visual Basic' variable End--> <!--How to Declare a 'Php' variable Begin--> <!--How to Declare a 'Php' variable End-->
<p> <span style="font-weight:bold;">Acknowledgment(s):</span> </p>
<p> <span>This article was written after reviewing tutorial(s) listed at&nbsp;<a href="http://www.techotopia.com/index.php/Ruby_Essentials">Techtopia</a>&nbsp;dot com.</span> </p>
<p>Photo courtesy of <a href="http://animals.nationalgeographic.com/">National Geographic</a>&nbsp;dot com.</p>
<p> <span>Give generously to the Libertarian effort to abolish the current prohibition against the planting of cannabis and hemp varietals in your county, state, province or country for the continued benefit of being able to listen to our songbirds &#39;chirp&#39;.</span> <span>&#8216;<a href="http://hempaz.com/Documents/2008801t_VOHO_EFA_Table.aspx">Birds Know Omega3™</a>&#8216;</span>
<p>   <span style="font-weight:bold;">Source:&nbsp;<a href="http://www.guardian.co.uk/environment/2008/jun/08/birds.linnet">Cannabis Achene Bird Feed Magazine</a></span> </p>
</p></div>
<div align="center">
<table border="3" cellspacing="0" style="background-color:white;padding:5px;">
<tbody>
<tr>
<td><img alt="Hempaz-Google Group" height="26" src="http://groups.google.com/groups/img/3nb/groups_bar.gif" width="132" /></td>
</tr>
<tr>
<td style="padding-left:5px;"><b>Subscribe to Hempaz-Google Group</b></td>
</tr>
<tr>
<td style="padding-left:5px;">Email:       </td>
</tr>
<tr>
<td align="right"><a href="http://groups.google.com/group/hempaz?hl=en">Visit this group</a> </td>
</tr>
</tbody>
</table></div>
<div class="featureContainer" style="text-align:left;">
<p> <a href="http://www.zazzle.com/ladies_wet_tee_garden_spaghetti_strap_tshirt-235071284209924032?group=womens&amp;lifeStyle=all&amp;rf=238675003811954431">Clik to Purchase Ladies Wet Tee™ Brand Spaghetti Strap Garden Top</a></p>
</div>
<div> <span style="font-weight:bold;">Feature Video:&nbsp;<a href="http://hempaz.com/Documents/Ruby-Constant-Ground.aspx">Sunshine of Your Love by Cream &#8216;en vivo&#8217; at the Albert Hall</a></span> </div>
<hr />
<div class="videoContainer" style="text-align:center;">   </div>
<div class="sourceContainer" style="text-align:center;">
<p> <span style="font-weight:bold;">Source: Original Composition from the 1967 album &#8216;Disraeli Gears&#8217;.&nbsp;<a href="http://www.livevideo.com/video/embedLink/7478C439F559493B8A82E4615E263682/540270/cream-sunshine-of-your-love-.aspx">Live from the &#8216;Elder Cream&#8217; Albert Hall Concert, England, 2005.</a></span> </p>
</p></div>
<div>
<p>   <span><a href="http://www.zazzle.com/ladies_wet_tee_garden_spaghetti_strap_tshirt-235071284209924032?group=womens&amp;lifeStyle=all&amp;rf=238675003811954431">Clik to Purchase Ladies Wet Tee™ Brand Spaghetti Strap Garden Top</a></span> </p>
<p style="text-align:center;">   <span>or,&#8230;</span> </p>
</p></div>
<div id="don1000100ate" style="text-align:center;">
<h3>Make a donation to the Medical Marijuana Initiative (MMI)™ Today!</h3>
</p></div>
<p> <!--MMI Secure Donation Link URL Begin-->
<div style="text-align:center;font-weight:bold;font-size:85%;"> <span>Clik&nbsp;<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&amp;hosted_button_id=7683956">here</a>&nbsp;to donate securely to the Medical Marijuana Initiative (<a href="http://hempaz.com/mmi.aspx">MMI</a>)™</span> </div>
<p> <!--MMI Secure Donation Link URL End--> <!--MMI Secure Donation FORM Begin--><br />
<h3 style="text-align:center;">Payments processed by Azjaguar Design &amp; Manf Co. via PayPal, Inc.</h3>
<div align="center">                         <img border="0" alt="" width="1" src="https://www.paypal.com/en_US/i/scr/pixel.gif" height="1" />            </div>
<p>     <!--MMI Secure Donation FORM End-->     <!--Robert Hempaz, PhD. Trichometry™ Signature Begin-->
<div style="font-size:105%;text-align:left;">
<p>         <span lang="es-mx" title="Gracias por su visitita, adios y...(sp.-usted) = Thank you for your short visit, travel with God and...(en.)">Gracias por su visitita, adios y&#8230;</span>       </p>
</p></div>
<div style="font-size:105%;text-align:center;">
<p>         <span lang="es-mx" title="¡Buenas suerte a vosotros! (sp.-ustedes) = Good luck to you all (en.)">¡Buenas suerte a vosotros!</span>       </p>
</p></div>
<div style="font-size:85%;text-align:right;">
<p>         <span>Robert&nbsp;<a href="http://hempaz.com/docmap.aspx">Hempaz</a>, PhD. Trichometry™</span><br />         <span>Blogged with Microsoft Windows Live Writer</span>       </p>
</p></div>
<p>     <!--Robert Hempaz, PhD. Trichometry™ Signature End-->
<div style="text-align:center;">
<p>         <span>Return to Hemp Arizona ( <a href="http://hempaz.com/sitemap.aspx">USA</a> )         Sitemap</span>       </p>
</p></div>
</p></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rubyzero.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rubyzero.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rubyzero.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rubyzero.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rubyzero.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rubyzero.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rubyzero.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rubyzero.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rubyzero.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rubyzero.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rubyzero.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rubyzero.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rubyzero.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rubyzero.wordpress.com/3/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rubyzero.wordpress.com&amp;blog=9089030&amp;post=3&amp;subd=rubyzero&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rubyzero.wordpress.com/2009/08/20/ruby-constant-declare/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/398d7c6573256e8ba71c4eeccda3c1d4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">getcapital</media:title>
		</media:content>

		<media:content url="http://lh3.ggpht.com/_DSBe3y9bUtg/SqAtfxAre4I/AAAAAAAACGc/0YvrXpE2ztA/s800/ruby-throat-hummingbird_160_x_110.png.jpg" medium="image">
			<media:title type="html">Ruby Throat Hummer</media:title>
		</media:content>

		<media:content url="http://groups.google.com/groups/img/3nb/groups_bar.gif" medium="image">
			<media:title type="html">Hempaz-Google Group</media:title>
		</media:content>

		<media:content url="https://www.paypal.com/en_US/i/scr/pixel.gif" medium="image" />
	</item>
	</channel>
</rss>
