Exercise 2: What 3.days.ago Actually Is — Possible Solution ==================================================================== WHAT KIND OF LANGUAGE OPERATION IT REPRESENTS ------------------------------ Per this chapter, 3.days.ago is not a helper function that takes the number 3 as an argument - it's a real method call directly on Ruby's own built-in Integer class. ActiveSupport adds the .days and related methods straight onto Integer itself, a technique called monkey-patching or reopening a class, where an existing class - including one of the language's own built-in core classes - is extended with new methods after the fact, anywhere in the codebase. WHY DJANGO AND LARAVEL'S ECOSYSTEMS DON'T LEAN ON THIS THE SAME WAY ------------------------------ Per this chapter, Python's own community explicitly discourages patching built-in types, consistent with the same "explicit is better than implicit" philosophy already visible in Django's own more spelled-out, field-by-field model declarations. PHP doesn't offer an equally natural mechanism for extending its own built-in scalar types like integers at all. Ruby, by contrast, treats reopening any class - including its own core ones - as an ordinary, idiomatic part of the language, which is exactly what lets ActiveSupport build fluent, chainable helpers like 3.days.ago directly onto a plain number. WHY THIS WORKS AS AN ANSWER ------------------------------ It correctly explains that 3.days.ago is a method call added directly onto Ruby's own Integer class rather than a wrapping function, and correctly explains that Python discourages this pattern while PHP lacks a natural equivalent mechanism, which is why neither ecosystem builds fluent helpers this way.