Skip to content

Ensure making a class abstract doesn't change the visibility of its .new #8

@amomchilov

Description

@amomchilov

The implementation in #3 will always make new public, regardless of the visibility it had previously.

Desired behaviour:

class PrivateNew
  private_class_method :new
end

class MyAbstractClass < PrivateNew
  abstract!
end

p MyAbstractClass.singleton_class.public_method_defined?(:new)
# is true, should be false

class MySubclass < MyAbstractClass; end

p MySubclass.singleton_class.public_method_defined?(:new)
# is true, should be false

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