C
Chinna Karuppan
Hi,
I am new to Ruby and This is a very basic question.when I type p self in
irb it gives me 'main'.
when I say class what is happening in the backend.since within a class
end I am able to call define_method which is a private method and should
never be available to anybody and another intersting thing is it is not
accessible outside of the
class.
so my question is how is a private method accessible outside
what is happening when a class is defined. it is of type Class
automatically...I don't quite get it.
As soon as you start IRB a main object is created which is of type
Object.is it is right statement...
THnks
Chinna
I am new to Ruby and This is a very basic question.when I type p self in
irb it gives me 'main'.
when I say class what is happening in the backend.since within a class
end I am able to call define_method which is a private method and should
never be available to anybody and another intersting thing is it is not
accessible outside of the
class.
so my question is how is a private method accessible outside
what is happening when a class is defined. it is of type Class
automatically...I don't quite get it.
As soon as you start IRB a main object is created which is of type
Object.is it is right statement...
THnks
Chinna