--KH9S6eoVXLBawpUJ
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Daniel Carrera (dcarrera / math.umd.edu) wrote:

> I don't quite understand what irb's "=>" is showing.  In particular, I'd like to 
> know how to change it.
> 
> Currently I get:
> 
> >> p = X**2 - 1
> => #<Math::Polynomial::Poly:0x1a4c48 @coeffs=[-1, 0, 1]>
> 
> And I'd rather it produce something like:
>>
> >> p = X**2 - 1
> => X**2 - 1
> 
> Or better yet:
> 
> >> p = X**2 - 1
> =>
>    2    
>   X  - 1
> >>
> 
> Is this possible?

It uses #inspect, so just define a #inspect method for Poly, and You'll
be set!

-- 
Eric Hodel - drbrain / segment7.net - http://segment7.net
All messages signed with fingerprint:
FEC2 57F1 D465 EB15 5D6E  7C11 332A 551C 796C 9F04


--KH9S6eoVXLBawpUJ
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.0 (FreeBSD)

iD8DBQE+Qt3xMypVHHlsnwQRAiqUAKCJXpHZL8w/DjksvtO0qauR2evy3QCfaKqK
4imoB+e8wYUSogu5hEaCCQ0¿ÇP
-----END PGP SIGNATURE-----

--KH9S6eoVXLBawpUJ--