M
Mickael Faivre-Macon
Hi,
What is called the process of adding a new method of an already defined class ?
For example:
class A
def a
end
end
And in another file:
class A
def b
end
end
And now my real question:
What if I want to declare a new class variable in the initialize method ?
If it's a derived class I can call super:
def initialize
super
@my_var = ""
end
but if it not derived ?
How can I do this ?
Thanks,
Mickael
What is called the process of adding a new method of an already defined class ?
For example:
class A
def a
end
end
And in another file:
class A
def b
end
end
And now my real question:
What if I want to declare a new class variable in the initialize method ?
If it's a derived class I can call super:
def initialize
super
@my_var = ""
end
but if it not derived ?
How can I do this ?
Thanks,
Mickael