Hi guys i have a question. i understand that "super" its used when you want to use the same attributes as the Parent class... but in this code why does it matter to put Super ?
class Message @@messages_sent = 0 def initialize(from, to) @from = from @to = to @@messages_sent += 1 end end my_message = Message.new("Phokgedi", "Pabalelo") #our instance class Email < Message def initialize(from, to) super end end
I would have just wrote:
class Email < Message; end
and this was going to inherit everything from superclass from my understanding without writing a method inside the inheritance. help me understand this concept of inheritance better if i'm wrong?