Skip to content

Kernel.y interferes with code relying on method_missing #664

@gmenel

Description

@gmenel

Good day,

I have coordinate objects in protobuf which have a .y attribute defined, but rely on method_missing to trigger calls to C.
Kernel.y intercepts the message and gives me an unexpected result.
I believe other systems which also rely on method_missing like nokogiri will cause the same trouble when trying to access an arbitrary "y" property in a document.

Can we rename the "y" patch to Kernel, to something less common, please?

def y *objects

Otherwise people who use x,y,z coordinates get adverse effects and have to implement a workaround like the following.

    def y
      send(:method_missing, :y)
    end

Even "yy" would be better. Thank you :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions