Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > How does one determine an objects class?

Reply
Thread Tools

How does one determine an objects class?

 
 
John Maclean
Guest
Posts: n/a
 
      02-01-2006
Say I've got
str = IO.read("testfile_for_using_file_open")
how can Idetermone what class this object belongs to?

--
John Maclean
MSc (DIC)
07739 171 531



 
Reply With Quote
 
 
 
 
James Edward Gray II
Guest
Posts: n/a
 
      02-01-2006
On Feb 1, 2006, at 10:13 AM, John Maclean wrote:

> Say I've got
> str = IO.read("testfile_for_using_file_open")
> how can Idetermone what class this object belongs to?


str.class

Hope that helps.

James Edward Gray II


 
Reply With Quote
 
 
 
 
Austin Ziegler
Guest
Posts: n/a
 
      02-01-2006
On 01/02/06, John Maclean <(E-Mail Removed)> wrote:
> Say I've got
> str =3D IO.read("testfile_for_using_file_open")
> how can Idetermone what class this object belongs to?


Which object?

-austin
--
Austin Ziegler * http://www.velocityreviews.com/forums/(E-Mail Removed)
* Alternate: (E-Mail Removed)


 
Reply With Quote
 
Chris Gernon
Guest
Posts: n/a
 
      02-01-2006
John Maclean wrote:
> Say I've got
> str = IO.read("testfile_for_using_file_open")
> how can Idetermone what class this object belongs to?


puts str.class

--
Posted via http://www.ruby-forum.com/.


 
Reply With Quote
 
Robert Klemme
Guest
Posts: n/a
 
      02-01-2006
John Maclean wrote:
> Say I've got
> str = IO.read("testfile_for_using_file_open")
> how can Idetermone what class this object belongs to?


str is of class String.

robert
























 
Reply With Quote
 
John Maclean
Guest
Posts: n/a
 
      02-01-2006
Thanks chaps! I must say that I am impressed with the speedy reply

On
Thu, 2 Feb 2006 01:13:56 +0900 John Maclean <(E-Mail Removed)> wrote:

> Say I've got
> str = IO.read("testfile_for_using_file_open")
> how can Idetermone what class this object belongs to?
>



--
John Maclean
MSc (DIC)
07739 171 531



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
class objects, method objects, function objects 7stud Python 11 03-20-2007 06:05 PM
How does one determine the language used on a windows OS? stylechief Perl Misc 10 12-06-2005 11:12 PM
JRuby: How does one keep Java objects as Java objects so they can be used in method calls? Steve Drach Ruby 3 06-19-2004 11:25 PM
nuby: determine method passed and determine the receiver that received the method Peņa, Botp Ruby 1 01-24-2004 07:51 PM



Advertisments