As we build out programs in Ruby with multiple classes, we learn that shared functionality between classes can be streamlined through Inheritance and Composition (i.e., Modules/Mixins). They effectively accomplish the same task by allowing us to write code in one place and use it in another place, staying true to the DRY (Don’t Repeat Yourself!) principle.
Today let’s take a quick look at how Keyword Arguments can help us avoid errors.
Welcome to a post where I look Under the Hood of Ruby! One of the beauties of Ruby is its elegance. When you find yourself writing multiple or repetitive lines of code, Ruby often has a pre-existing method that encapsulates your intent. In this post, my goal is to walk-through what is going on Under the Hood of helpful Ruby syntax.
// ♥ irb
2.2.3 :001 > puts "Hello World!"
Hello World!