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

Added yard docs to circular buffer class. #506

Merged
merged 2 commits into from
Dec 10, 2018

Conversation

Cawllec
Copy link
Contributor

@Cawllec Cawllec commented Dec 6, 2018

Goal

Adds Yard doc comments to the circular buffer class.

@Cawllec Cawllec requested a review from a team December 6, 2018 13:28
@@ -2,30 +2,57 @@ module Bugsnag::Utility
class CircularBuffer
include Enumerable

# @return [Numeric] the current maximum allowable number of items
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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.

Copy link
Contributor

@tobyhs tobyhs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@Cawllec Cawllec merged commit 06fc197 into breadcrumbs/base Dec 10, 2018
@Cawllec Cawllec deleted the breadcrumbs/circular-buffer-docs branch December 10, 2018 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants