Top "Instance-variables" questions

In object-oriented programming with classes, an instance variable is a variable defined in a class (i.e. a member variable), for which each object of the class has a separate copy.

Rails: access controller instance variable in CoffeeScript or JavaScript asset file

In Rails 3.1 it is not possible to access controller instance variables in an asset js.erb or coffee.erb file …

ruby-on-rails controller coffeescript erb instance-variables
Should all member variables be initialized in __init__

Maybe this is more of a style question than a technical one but I have a class with several member …

python oop instance-variables
Object-Oriented Perl constructor syntax and named parameters

I'm a little confused about what is going on in Perl constructors. I found these two examples perldoc perlbot. package …

perl constructor oop instance-variables
How do I set an attr_accessor for a dynamic instance variable?

I dynamically created an instance variable within my class: class Mine attr_accessor :some_var def intialize @some_var = true …

ruby instance-variables attr attr-accessor
Are ints always initialized to 0?

Is it safe to count on ints always being initialized to 0 in Objective-C? More specifically, when an object with int …

objective-c initialization int instance-variables
how do I test that an instance variable is set in my my mailer with rspec?

How do I test that a certain instance variable is set in my my mailer with rspec? assigns is coming …

ruby-on-rails rspec instance-variables
Properties and Instance Variables in Objective-C

I'm rather confused about properties and instance variables in Objective-C. I'm about half-way through Aaron Hillegass's "Cocoa Programming for Mac …

objective-c cocoa cocoa-touch properties instance-variables
Ruby class instance variables and inheritance

I have a Ruby class called LibraryItem. I want to associate with every instance of this class an array of …

ruby class instance-variables
What is the difference between ivars and properties in Objective-C

What is the semantic difference between these 3 ways of using ivars and properties in Objective-C? 1. @class MyOtherObject; @interface MyObject { } @property (…

objective-c properties instance-variables
Why does Scala language require you initialize a instance variable instead of relying on a default value?

Scala language requires you initialize your instance variable before using it. However, Scala does not provide a default value for …

scala initialization default-value instance-variables