Skip to content

Default Style/Alias to prefer alias_method? #14321

@esotericpig

Description

@esotericpig

Since Ruby v3.0, alias_method returns the alias name created, while alias does not. This allows for DSL chaining:

private alias_method :one, :two

alias returns nil, so, this is invalid:

private alias one two

I usually see that RuboCop favors new features/abilities in its defaults, such as anonymous & and ..., so I think this change would better align with RuboCop's defaults.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy