Top "Self" questions

A keyword used in instance methods to refer to the object on which they are working.

Instance variable: self vs @

Here is some code: class Person def initialize(age) @age = age end def age @age end def age_difference_with(…

ruby self instance-variables
Python - Is it okay to pass self to an external function

I have a class, A, which is inherited by a bunch of other classes. Some of these have a few …

python self
Can anybody please explain (my $self = shift) in Perl

I'm having a really hard time understanding the intersection of OO Perl and my $self = shift; The documentation on these …

perl attributes self shift moose
When to use self in Model?

Question: when do I need to use self in my models in Rails? I have a set method in one …

ruby-on-rails ruby-on-rails-3 ruby-on-rails-3.1 self
When trying to invoke def, I get: parameter 'self' unfilled

I'm trying to write a class to randomly pick a number of songs from a dictionary. The whole point of …

python-2.7 class oop self
Does @synchronized(self) create a block where the self prefix is unecessary on properties?

I have read something in some foreign code and I want to check my assumption: @synchronized(self) is used to …

objective-c synchronized self declared-property
How to keep track of class instances?

Toward the end of a program I'm looking to load a specific variable from all the instances of a class …

python class dictionary self instances
What does "self" mean in javascript?

I read here that "self Refers to the current window or form". Self does not seem to refer to the …

javascript dom keyword self
What is the difference between class and instance variables?

What is the difference between class and instance variables in Python? class Complex: a = 1 and class Complex: def __init__(self): …

python class variables self
How to call an Objective-C Method from a C Method?

I have an Obj-C object with a bunch of methods inside of it. Sometimes a method needs to call another …

objective-c self