Skip to content

Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →

class method

Warning.[]

(::Warning::category) -> bool
Warning[category] → true or false

Returns the flag to show the warning messages for category. Supported categories are:

:deprecated

deprecation warnings

  • assignment of non-nil value to $, and $;

  • keyword arguments

etc.

:experimental

experimental features

:performance

performance hints

  • Shape variation limit

See also .[]= .categories also in 4.0 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0