Inheritance in Ruby, in pictures – Jake Zimmerman

This is as simple as it gets. Most languages use the extends keyword to inherit from a class. Ruby cutely uses the < token, but otherwise it’s very straightforward. When we call on_parent on an instance of Child, Ruby finds the right method to call by walking the inheritance hierarchy up to where that method is defined on Parent.I picture Ruby’s < operator as working something like this:.
Inheritance in Ruby, in pictures – Jake Zimmerman #ruby #rubydeveloper #rubyonrails https://rubyonrails.ba/single/inheritance-in-ruby-in-pictures-jake-zimmerman

Nezir Zahirovic

Contractor Ruby On Rails (8+ years) / MCPD .Net / C# / Asp.Net / CSS / SQL / (11 years)

related articles