ActiveSupport::ArrayInquirer — Wrapping an array in an ArrayInquirer gives a friendlier way to check its string-like contents.
| Use Case | Command | Description |
|---|---|---|
| 🔍 Check if a variant is present | variants.phone? |
Returns true if :phone is in the array |
| 🔍 Check if a variant is present | variants.tablet? |
Returns true if :tablet is in the array |
| 🔍 Check if a variant is absent | variants.desktop? |
Returns false if :desktop is not in the array |
| 🔍 Check if any element matches | variants.any? |
Returns true if the array has any elements |
Wrapping an array in an ArrayInquirer gives a friendlier way to check its string-like contents:
variants = ActiveSupport::ArrayInquirer.new([:phone, :tablet])
variants.phone? # => true
variants.tablet? # => true
variants.desktop? # => false
any? — Returns true if the array has at least one elementActiveSupport::ArrayInquirer on RubyDocGenerated 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