How to Use Queues in Ruby

A queue is like a waiting list. Imagine you’re waiting in line to buy the latest Apple product, getting a movie ticket, or to pay for your groceries. These are queues! You can use queues in your Ruby projects. How? Queues allow you to process things in order of arrival, so they can be helpful … Read more

How to Use The Ruby Gets & Chomp Methods

You’re writing a Ruby program & you want to ask the user a question… How can you do that? Well, you can use the Ruby gets method to read user input. You can call gets. Then your program starts waiting for you to type something with your keyboard & press the enter key. The result? … Read more

How to Use Scopes in Ruby on Rails

What is a scope in Rails & why is it useful? Well… Scopes are custom queries that you define inside your Rails models with the scope method. Every scope takes two arguments: It looks like this: As a result of calling a scope, you’ll get an ActiveRecord::Relation object. Which means you can chain & combine … Read more

Ruby Syntax Reference For Beginners

This is a Ruby syntax reference. Learning Ruby can be overwhelming with everything you have to remember. That’s why I put together this syntax reference for you! It will help refresh your memory & quickly review what you need to know to write Ruby programs. Have fun! Contents Strings A string is a sequence of … Read more