# Ruby/C question

**URL:** <https://www.ruby-forum.com/t/ruby-c-question/177252>\
**Category:** Rails\
**Created:** [October 14, 2009, 7:20am UTC](https://www.ruby-forum.com/t/ruby-c-question/177252 "2009-10-14T07:20:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jeffrey\_LSTaylor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ee7513/32.png) [@Jeffrey\_LSTaylor](https://www.ruby-forum.com/u/Jeffrey_LSTaylor)\
**Post date:** [October 14, 2009, 7:20am UTC](https://www.ruby-forum.com/t/ruby-c-question/177252/1 "2009-10-14T07:20:08Z")

</div>

I am working with libxml-ruby, the Ruby wrapper for the C libxml. I  
don’t  
understand one section (rxml\_reader\_io). The line below (‘result’ is  
the Ruby  
VALUE for the object):

rb\_ivar\_set(result, IO\_ATTR, io);

where:

IO\_ATTR = ID2SYM(rb\_intern("@io"));

The comments lead me believe that the first line is setting an instance  
variable, but the second line is defining a symbol, :io or maybe :@io.

It seems to me that the first line should be:

rb\_ivar\_set(result, rb\_intern("@io"), io);

or equivalent.

The other question is there anyway to access the value set in the first  
statement from Ruby? Or do I have to correct the library source and  
rebuild?

TIA,  
Jeffrey
