-
Notifications
You must be signed in to change notification settings - Fork 176
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
Added yard docs to circular buffer class. #506
Conversation
@@ -2,30 +2,57 @@ module Bugsnag::Utility | |||
class CircularBuffer | |||
include Enumerable | |||
|
|||
# @return [Numeric] the current maximum allowable number of items |
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.
This should be [Integer]
instead of [Numeric]
# | ||
# If this causes the buffer to exceed its maximum items, the oldest item will be removed | ||
# | ||
# @param item [Any] the item to add to the buffer |
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.
This should probably be [Object]
(although I could be wrong and wouldn't be surprised if I wasn't aware of some [Any]
or [any]
convention in yardoc)
attr_reader :max_items | ||
|
||
## | ||
# Creates a circular buffer |
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.
The main description portion of yard comments for #initialize
is not needed as yard is smart enough to generate a generically useful one (but leave the @param
comment in)
## | ||
# Creates a circular buffer | ||
# | ||
# @api private |
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.
If users aren't exposed to the CircularBuffer
in any direct way, move this @api private
comment to the class (right before line 2). Also related, add a brief comment comment for the CircularBuffer
class.
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.
lgtm
Goal
Adds Yard doc comments to the circular buffer class.