Accessing object contents

=> #<Dnsruby::Name:>

what’s the proper way of getting to “”? is it
with the to_s method?


On Sat, Mar 19, 2011 at 11:22 PM, John D. [email protected] wrote:

Override the to_s method in your class and define it to print out the
of variable. Then you can call to_s method on the object.

John D. wrote in post #988311:

=> #<Dnsruby::Name:>

Is that output from irb? irb uses the “inspect” method to display a

what’s the proper way of getting to “”?

Depends entirely on the class in question. Look at the documentation for
Dnsruby::Name, or at the source code, to see what methods are available.