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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Page 6 of 6 - 112 questions