<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Rails Forum - Ruby on Rails Help and Discussion Forum - What is extension of ruby Exception class object in c?]]></title>
		<link>http://railsforum.com/viewtopic.php?id=46151</link>
		<description><![CDATA[The most recent posts in What is extension of ruby Exception class object in c?.]]></description>
		<lastBuildDate>Wed, 14 Sep 2011 10:06:16 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[What is extension of ruby Exception class object in c?]]></title>
			<link>http://railsforum.com/viewtopic.php?pid=144854#p144854</link>
			<description><![CDATA[<p>static VALUE myMethod(VALUE self, VALUE exc)<br /> {&nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; int a = TYPE(exc); <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; printf(&quot; %d &quot;, a );<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // Some process on exc<br /> }<br /> void Init_myRuby()<br /> { <br />&nbsp; &nbsp; VALUE mRuby = rb_define_module(&quot;myRuby&quot;); <br />&nbsp; &nbsp; &nbsp;VALUE mException = rb_define_class_under(mRuby, &quot;Exception&quot;, rb_eRuntimeError);<br />&nbsp; &nbsp; &nbsp;rb_define_singleton_method(mRuby, &quot;myMethod&quot;, myMethod, 4); <br /> }</p><p> Following is the code of ruby client script,</p><p>require &#039;myRuby&#039;<br /> def raiseExc() <br />&nbsp; &nbsp; exception = myRuby::Exception.new(&quot;status&quot;,&quot;lasterror&quot;,&quot;function()&quot;,&quot;Calling some&quot;) <br />&nbsp; &nbsp; myRuby::myMethod(exception, &quot;Exception message: %s, Exception object %d&quot;, &quot;Hi from Exception&quot;, 100)<br /> end </p><p>raiseExc()</p>]]></description>
			<author><![CDATA[dummy@example.com (salunke09)]]></author>
			<pubDate>Wed, 14 Sep 2011 10:06:16 +0000</pubDate>
			<guid>http://railsforum.com/viewtopic.php?pid=144854#p144854</guid>
		</item>
	</channel>
</rss>
