Ruby init Method Cannot Access @ins

For general discussion related FlowStone
Post Reply
User avatar
fabb
Posts: 6
Joined: Wed Feb 20, 2008 9:06 pm

Ruby init Method Cannot Access @ins

Post by fabb »

I'd like to initialize some instance variables according to the current value on one of the @ins.
@ins is nil in the init method though. Is this a bug?

Workaround: set the instance variable in the event method if it is nil.
User avatar
trogluddite
Posts: 1730
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

Re: Ruby init Method Cannot Access @ins

Post by trogluddite »

Hi fabb,
Yes that's perfectly normal - and you got the right solution too.
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
Post Reply