-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Please use a different name for "class" #2006
Comments
Sure. I think specialization would be a better name. |
Fixes faker-ruby#2006. This PR solves an issue of overriding Ruby's built-in `Object#class` method. I'd like to maintain `HeroesOfTheStorm.class`'s behavior for a period of time. But I chose to make a breaking change because it differs from the expected behavior for built-in `Object#class` method. I think that the warning for `HeroesOfTheStorm.class` will be removed in near future.
@thejonanshow Hi, Jonan 👋 Thank you for the feedback. I've opened #2031. BTW, RubyKaigi 2020 cancellation announced today 😢 Anyway, I'm glad to meet you on GitHub :-) Thank you. |
HI! 👋 I saw the news, it's very sad but I'm sure we'll get to meet our friends by the river again soon. Thank you for the PR! |
Fixes faker-ruby#2006. This PR solves an issue of overriding Ruby's built-in `Object#class` method. I'd like to maintain `HeroesOfTheStorm.class`'s behavior for a period of time. But I chose to make a breaking change because it differs from the expected behavior for built-in `Object#class` method. I think that the warning for `HeroesOfTheStorm.class` will be removed in near future.
Fixes #2006. This PR solves an issue of overriding Ruby's built-in `Object#class` method. I'd like to maintain `HeroesOfTheStorm.class`'s behavior for a period of time. But I chose to make a breaking change because it differs from the expected behavior for built-in `Object#class` method. I think that the warning for `HeroesOfTheStorm.class` will be removed in near future.
So I was investigating some odd behavior in Ruby this evening and tried to find an object in memory based on it's ancestors with something like this:
Imagine my surprise when I received the following error:
Assuming that Ruby had not added some new
Melee Assassin
object that had escaped my attention I went looking for the culprit:I think it's fair to say we can all agree taking over a method like
:class
is pretty suboptimal, so I thought I'd make a PR to fix it, but I realized that someone, somewhere is most definitely using this code, and their tests will break with some equally confusing errors.Any thoughts on how to go about undoing this one? There may not be any option but to rename this method
hero_class
or something similar and let their tests break. Maybe @illsism wants to recommend an alternative name?faker/lib/faker/games/heroes_of_the_storm.rb
Lines 29 to 31 in 48fcc17
The text was updated successfully, but these errors were encountered: