StringIO

E

Eugen Naiman

Hello,

I have to apologize if there is an obvious answer to my issue - we were
all beginners once ...

I have just started playing with ruby couple days ago.

My problem is: when I run the script (in SciTe) instead of seeing the
result, I see only a referrence like this:
#<StringIO:0x2c62364>

then the script exits.
I know the return must be quite a long list but I can't see it.
I've searched the Internet hoping to understand what this output is; I
came to understand something but it is definitely not enough to help me
see the output.

How can I see the content of this StringIO?

this is my script:


require 'rubygems'
require 'spectools'
require 'vnmsh'

SpecTools::Config.default_access_method = :cli
session = VNMSH.new()
session.connect
VNMSH.default_session = session
models = SpecTools::Model.find({:name, '1A2'}).first
IP_addr = Attr.new()
IP_addr.id = '0x12d7f'
tt = session.show_attributes:)model, models, {:name,"Condition"})
puts tt

Thank you very much,
 
A

Aaron Patterson

Eugen said:
Hello,

I have to apologize if there is an obvious answer to my issue - we were
all beginners once ...

I have just started playing with ruby couple days ago.

My problem is: when I run the script (in SciTe) instead of seeing the
result, I see only a referrence like this:
#<StringIO:0x2c62364>

then the script exits.
I know the return must be quite a long list but I can't see it.
I've searched the Internet hoping to understand what this output is; I
came to understand something but it is definitely not enough to help me
see the output.

How can I see the content of this StringIO?

StringIO#string will give you the underlying StringIO content. Here's
output from my irb session:

$ irb
You should also check out the StringIO docs:

http://ruby-doc.org/stdlib/libdoc/stringio/rdoc/index.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,817
Latest member
DicWeils

Latest Threads

Top