given
=> #<Dnsruby::Name: www.nbc.com.>
what's the proper way of getting to "www.nbc.com."? is it
with the to_s method?
obj.to_s
···
--
Posted via http://www.ruby-forum.com/.
given
=> #<Dnsruby::Name: www.nbc.com.>
what's the proper way of getting to "www.nbc.com."? is it
with the to_s method?
obj.to_s
--
Posted via http://www.ruby-forum.com/.
Override the to_s method in your class and define it to print out the value
of variable. Then you can call to_s method on the object.
On Sat, Mar 19, 2011 at 11:22 PM, John Doe <fleshins@gmail.com> wrote:
given
=> #<Dnsruby::Name: www.nbc.com.>what's the proper way of getting to "www.nbc.com."? is it
with the to_s method?obj.to_s
--
Posted via http://www.ruby-forum.com/\.
--
Mayank Kohaley
John Doe wrote in post #988311:
given
=> #<Dnsruby::Name: www.nbc.com.>
Is that output from irb? irb uses the "inspect" method to display a
value.
what's the proper way of getting to "www.nbc.com."?
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.
--
Posted via http://www.ruby-forum.com/\.