Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stub_const polishing #48014

Merged
merged 1 commit into from
Apr 21, 2023
Merged

stub_const polishing #48014

merged 1 commit into from
Apr 21, 2023

Conversation

fxn
Copy link
Member

@fxn fxn commented Apr 21, 2023

Just some polishing:

  • Fixes the assert_equal line in the documentation, should not have an assignment.
  • Constants belong to class and module objects. Since Class < Module, the conventional name for the first parameter is mod.
  • The code works under the assumption that the constant belongs to the first argument. For example, remove_const would not work otherwise, and also you const_set on that object. To be consistent with this, we pass a false second argument to const_get.
  • Adds a test that specifies what should happen if the constant does not exist in the receiver.

@fxn fxn merged commit e571aba into main Apr 21, 2023
15 checks passed
@fxn fxn deleted the polish-stub_const branch April 21, 2023 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant