-
Notifications
You must be signed in to change notification settings - Fork 51
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
Refactor NullClassBuilder#generate_class #32
base: master
Are you sure you want to change the base?
Conversation
This patch no longer applies cleanly to |
@sferik sure. I'll look at it tomorrow and see if it still makes sense to apply this patch. |
@sferik oops. I still don't know anything about Rubocop, so I guess I'll just continue it tomorrow. The rspec tests pass though. Edit: I get it now. The |
@padi If you can find a way to refactor further that doesn’t increase the length of the class, that would be great. Otherwise, I think it’s okay to increase the RuboCop limit to 147 (or an even 150). |
- Replace method w/ method object
@sferik it's ok now. Let me know what you think. |
@base_class = builder.base_class | ||
end | ||
|
||
def execute(generation_mod, customization_mod) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When there is a class that only does one thing, I like to name that method call
. This makes it easy to substitute with a proc
, lambda
, or Method
object. There’s actually a RubyTapas episode about this, which describes why this can be useful. 😄
0fa92ab
to
4397306
Compare
1dc5ada
to
72228eb
Compare
Seems that this can be refactored further.