⚠️ Error generated by delegate when a method is called on nil and allow_nil option is not used.
| Use Case | Command | Description |
|---|---|---|
| ⚠️ Catch delegation error | rescue Module::DelegationError | Handle the case where a delegate method is called on nil |
| 📦 Create delegate with nil check | delegate :method, to: :@obj, allow_nil: false | Explicitly disallow nil delegation (default behavior) |
| ✅ Allow nil delegation | delegate :method, to: :@obj, allow_nil: true | Suppress error when nil is the delegate target |
Generated by phpman v4.9.26-1-g511901d · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-07-27 16:33 @216.73.216.194
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Enhanced by LLM: deepseek-v4-flash / taotoken.net / www.chedong.com - original format