Questions

Ruby questions

Choose a question page, learn the concept, then test your understanding with a quiz.

Should Gemfile.lock Be Committed in Ruby? A Beginner-Friendly Guide

Learn when to commit Gemfile.lock in Ruby projects, when to ignore it, and how Bundler uses it for consistent dependencies.

rubygitversion-controlbundler

Understanding Ruby's Double-Colon :: Operator

Learn what Ruby's :: operator does, how constants and namespaces work, and why it does not bypass private or protected access rules.

rubysyntaxoperators

Understanding `class << self` in Ruby

Learn what `class << self` means in Ruby, how it works, when to use it, and how it compares to other ways of defining class methods.

rubymetaclasseigenclasssingleton

Understanding nil?, empty?, and blank? in Ruby and Rails

Learn the difference between nil?, empty?, and blank? in Ruby on Rails with examples, comparisons, common mistakes, and practical usage.

rubyruby-on-rails

Understanding the Rails Authenticity Token in Ruby on Rails

Learn what the Rails authenticity token is, why it exists, and how it protects forms from CSRF attacks in Ruby on Rails apps.

rubyruby-on-railsauthenticity-token

What %w Means in Ruby: Array of Strings Syntax Explained

Learn what %w means in Ruby, how it creates arrays of strings, when to use it, and how it compares to normal array syntax.

rubyarraysstringnotation

What `map(&:name)` Means in Ruby

Learn what `map(&:name)` means in Ruby, how `&:` works with `map`, and how it compares to block syntax in real Ruby and Rails code.

rubysyntaxoperatorsparameter-passing

What attr_accessor Means in Ruby: Getters and Setters Explained

Learn what attr_accessor does in Ruby, how it creates getters and setters, and when to use attr_reader or attr_writer instead.

ruby

What ||= Means in Ruby: Understanding the Or-Equals Operator

Learn what ||= means in Ruby, how it works with nil and false, and when to use it for default values, memoization, and cleaner code.

rubyoperators

When to Use RSpec let vs before in Ruby Tests

Learn the difference between RSpec let and before in Ruby. Understand lazy evaluation, memoization, setup patterns, and when to use each.

rubyrspec

Why `rescue Exception` Is Bad Style in Ruby

Learn why rescuing Exception in Ruby is dangerous, what to rescue instead, and how to handle errors safely in real code.

rubyexception

Why rbenv Is Not Changing Ruby Version on macOS or Ubuntu

Learn why rbenv may not switch Ruby versions and how PATH, shims, and shell setup affect which Ruby runs.

rubyrbenv

Page 6 of 6 - 112 questions