-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Address yard issues #1379
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
Address yard issues #1379
Changes from all commits
2c31ce1
2345fcb
a640902
cd67b84
03d8cbe
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,13 @@ module Rails | |
module ViewRendering | ||
extend ActiveSupport::Concern | ||
|
||
attr_accessor :controller | ||
# @!attribute [r] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I assume this is just here to declare the attribute is read-only, right? Should we consider changing There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oops, that was a copy-paste mistake. But yes, I believe you are correct, we should note that |
||
# Returns the controller object instance under test. | ||
attr_reader :controller | ||
|
||
# @private | ||
attr_writer :controller | ||
private :controller= | ||
|
||
# DSL methods | ||
module ClassMethods | ||
|
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.
Is
instance_exec
really necessary to fix up the yard?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.
YARD issues warnings about writing the methods directly on the object:
Using
instance_exec
provides access to the same singleton scope allowing us to write the methods. Another option would be place all of those methods into a module and then access the singleton class directly (providing proper 1.8.7 backwards compat) toinclude
the aforementioned module.