Ensure making a class abstract doesn't change the visibility of its `.new`
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 48/100
Research direction
Start by reading the abstract-class implementation introduced in issue #3 and trace how abstract! changes the class's singleton methods. Reproduce the visibility checks with PrivateNew, MyAbstractClass, and MySubclass from this issue; done means both checks remain false when inherited .new was private.
Written by the indexing model from the issue text.
Description
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
- Dominant language
- Ruby
- Stars
- 3
- Forks
- 5
- Avg merge
- 8d 23h
- Merged PRs (30d)
- 8
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Shopify/type_toolkit
-
good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Shopify/type_toolkit#4 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
Shopify/type_toolkit#45 ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
Shopify/type_toolkit#20 ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
Shopify/type_toolkit#14 ·
-
good first issue
Difficulty 4/5 3-5 days Newbie friendliness 48/100
Shopify/type_toolkit#11 · 3 comments ·
All issues in Shopify/type_toolkit
Similar issues
-
user-reported
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Kong/developer.konghq.com#7316 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
TheOdinProject/curriculum#31408 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
bensheldon/good_job#1816 · 5 comments ·