# Different between instance=(value) and instance(value)?

**URL:** <https://www.ruby-forum.com/t/different-between-instance-value-and-instance-value/113219>\
**Category:** Rails\
**Created:** [August 28, 2007, 11:33pm UTC](https://www.ruby-forum.com/t/different-between-instance-value-and-instance-value/113219 "2007-08-28T23:33:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jamal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/35a633/32.png) [@jamal](https://www.ruby-forum.com/u/jamal)\
**Post date:** [August 28, 2007, 11:33pm UTC](https://www.ruby-forum.com/t/different-between-instance-value-and-instance-value/113219/1 "2007-08-28T23:33:15Z")

</div>

Hello,

I was trying to create instance variable in runtime.

I want to be able to do it this way, but it’s not working, I cannot  
access @page later on in my code?

def instance\_name=(value)  
self.instance\_variable\_set ‘@page’, value  
end

This one works, but make my code ugly 😛

def instance\_name(value)  
self.instance\_variable\_set ‘@page’, value  
end

My question is why is’t working with the second choice and not the first  
one?

They are both methods, the first one is a attribute method which should  
act as any other method type? or did I misunderstand something?

Thanks in advance…

//Jamal
