<html>
<head>
<title>SWIG:Examples:ruby:class</title>
</head>

<body bgcolor="#ffffff">


<tt>SWIG/Examples/ruby/class/</tt>
<hr>

<H2>Wrapping a simple C++ class</H2>

<p>
This example illustrates wrapping a simple C++ class to give a Ruby class.

<h2>The C++ Code</h2>

Suppose you have some C++ classes described by the following (and admittedly lame) 
header file:

<blockquote>
<pre>
/* File : example.h */

class Shape {
public:
  Shape() {
    nshapes++;
  }
  virtual ~Shape() {
    nshapes--;
  }
  doub