Select Page

Month: February 2017

Ruby: When to Use Symbol or String?

Symbols are just a way to name something. Typically it’s used to name attributes in a class or for options (colors, types of cuisines, type of shoe, etc). In essence, a constant string.   Use Strings instead of a...

Read More

Ruby Methods Basics

Methods are great for DRYing up your code and organizing logic in a single place. They act a little bit like a black box. Here are some tidbits that might not be so obvious with Ruby methods. All methods have to be called on an...

Read More

Ruby Variables Basics

Variables in Ruby are basically pointers to an object in memory (heap). a = “bacon” puts “a’s object id: #{a.object_id}” # b points to the same Object as a b = a puts “b’s object id:...

Read More

Ruby Blocks Tutorial

Sometimes we need to make our code more expressive and tidy but at the same time flexible and easier to use. Learning how to use Ruby blocks appropriately will level you up as a Ruby programmer. Sometimes we like to...

Read More
  • 1
  • 2