# Moment of Ruby: an argument for nothing

DevFeed: [Moment of Ruby: an argument for nothing](<https://devfeed.tech/articles/moment-of-ruby-an-argument-for-nothing-112767.md>)

Original publisher: [Read original article](<https://www.aha.io/engineering/articles/moment-of-ruby-an-argument-for-nothing>)

Published: 2026-11-02T00:00:00Z

Content type: article

Language: en

Sources: [Aha! Engineering Blog](<https://devfeed.tech/sources/aha-engineering-blog.md>)

Topics: [Ruby](<https://devfeed.tech/topics/ruby.md>), [Ruby on Rails](<https://devfeed.tech/topics/ruby-on-rails.md>)

Tags: [argument](<https://devfeed.tech/tags/argument.md>), [module](<https://devfeed.tech/tags/module.md>), [ruby](<https://devfeed.tech/tags/ruby.md>)

## AI overview

Ruby evaluates a default argument expression only when the caller omits that argument. Assigning a marker in that expression lets a method distinguish omission from explicit `false` or `nil` without a separate sentinel object: when omitted, the marker is set; when any value is supplied, the assignment does not run. The article demonstrates using this to preserve getter behavior while allowing false and nil to be stored, and notes that Rails uses the same pattern in `index_with` to distinguish no default from a supplied default. The example's behavior depends on Ruby's evaluation of default arguments.

## Source excerpt

Last week I learned a technique in Ruby so small and useful, I couldn't believe I hadn't come across it before. Suppose a method doubles as a getter and setter. Pass a value to update a setting, or pass nothing to read it: module Cloakable def clo