Learn Hotwire

learn

learn
The Adapter Pattern in Ruby

The Adapter Pattern in Ruby

Jan 6, 2022 - 5 min read

The Adapter pattern allows you to make incompatible objects work well together by using an adapter object....

The Strategy Pattern in Ruby

The Strategy Pattern in Ruby

Jan 4, 2022 - 5 min read

In this post we're going to take a look at how the Strategy Pattern works in Ruby....

Symbols vs. Strings in Ruby

Symbols vs. Strings in Ruby

Aug 29, 2021 - 6 min read

If you're curious, as I was, about which one to choose, or why there are both available, or which one is better, then keep reading as I will explain everything you need to know about the differences b...

Hash vs. Dictionary

Hash vs. Dictionary

Aug 5, 2021 - 5 min read

The Ruby Hash is an implementation of the dictionary concept, where the keys (in the key, value pair) are unique numbers. A dictionary is a general concept that maps unique keys to non-unique values....

What is Type-Driven Design/Development in Ruby

What is Type-Driven Design/Development in Ruby

Feb 5, 2021 - 2 min read

Type Driven Development and Ruby might sound like apples and oranges but it's actually very useful....

How to Use Strings in Ruby

How to Use Strings in Ruby

Jul 29, 2020 - 7 min read

I remember when I first heard about strings. I wanted to create a command line application that would ask the user for his name and age....

How to Use the Ruby Map Method

How to Use the Ruby Map Method

Jul 29, 2020 - 4 min read

I think it’s so cool that the Ruby map method exists. It means that Ruby has support for higher-order functions, and functional programming....

How to Test Ruby Modules With Rspec

How to Test Ruby Modules With Rspec

Jul 20, 2018 - 3 min read

When you have a module that you include in other classes, the way you test it might not be obvious. This is what I'm going to show you in this tutorial....

Let vs. Let! vs. Instance Variables in RSpec

Let vs. Let! vs. Instance Variables in RSpec

Jul 19, 2018 - 4 min read

A common source of confusion when using RSpec is whether to use let, let!, or an instance variable, for storing state. In this article I’ll try to explain the difference between let, let!, and instanc...