Matt Moore

C++

Ruby supports bitwise operators. Most languages support these operators. But most guides I've seen demonstrate these operators with binary values. What if we apply these in Ruby to arrays
If we have…

Read

Ruby » Ruby's Inject Method

Apr 24, 2017

In many other languages, if you have a list of things you are summing together, you would normally have a list of numbers and then a loop. Here's what I mean using Ruby

numbers = [1, 2, 5,
Read

What's a method

A method is just a function that is defined inside a class. Ruby has two types of methods: class and instance. A class method belongs to the class and cannot be called from an…

Read

Ruby differentiates between class variables and instance variables. For newcomers to Ruby, the difference might be difficult to grok. Let's examine the following class

class Robot
  require
Read

In an earlier post I began addressing a question that's been making the rounds: Should I use if statements? I've heard good programmers don't use them. You…

Read

I have been asked a lot lately about whether good programmers don't use if statements. I find this question amusing because it seems that those who ask about it almost have a fear of if statements. I…

Read

A while ago I had written about operator overloading in C++. I was asked about whether Ruby can do this—absolutely
Let's define a Ruby Box class, and override the + * / operators:

class
Read

Initial Environment Setup

There are different ways to install Ruby/Rails on Mac OS. I use three main tools:

  1. On Mac OS, you really should use Homebrew. Run the setup command…
Read